my code: local Player = game.Players.LocalPlayer local Character = Player.Character…
- User
my code: local Player = game.Players.LocalPlayer local Character = Player.Character local MainFrame = script.Parent local Camera = workspace.CurrentCamera local Humanoid = Character.Humanoid
local Exceptions = { FP = function() end, ExcludedFrame2 = function() end, -- if the player presses a button that is not supposed to have a frame, -- the code in here will run. }
local function onButtonClick(button) if Exceptions[button.Name] then Exceptionsbutton.Name else local targetFrame = MainFrame.Parent:FindFirstChild(button.Name) if targetFrame and targetFrame:IsA("Frame") then targetFrame.Visible = true print("Frame named '" .. targetFrame.Name .. "' is now visible.") else warn("Frame named '" .. targetFrame.Name .. "' not found.") end end end
for _, child in MainFrame:GetChildren() do if child:IsA("TextButton") then child.MouseButton1Click:Connect(function() onButtonClick(child) end) end end
other code:
wait(1); cam = workspace.CurrentCamera; pal = game.Players.LocalPlayer.Character; local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local run = game:GetService("RunService") local maxDegree = math.rad(80)
deb = "TPS";
function updatetransparency(targ,bool) for i,v in pairs(targ:GetChildren()) do if v:IsA("Accessory") then updatetransparency(v,bool) elseif v:IsA("BasePart") then --HatAttachment FaceCenterAttachment HairAttachment NeckAttachment if v:FindFirstChild("HatAttachment") or v:FindFirstChild("FaceCenterAttachment") or v:FindFirstChild("FaceFrontAttachment") or v:FindFirstChild("FaceRearAttachment") or v:FindFirstChild("HairAttachment") or v:FindFirstChild("NeckAttachment") then if bool then v.LocalTransparencyModifier = 1 else v.LocalTransparencyModifier = v.Transparency end end end end end
function updatechartransparency(targ,bool) for i,v in pairs(targ:GetChildren()) do if v:IsA("BasePart") then if bool or v.Name == "Head" then v.LocalTransparencyModifier = 1 else v.LocalTransparencyModifier = v.Transparency end updatetransparency(v,bool) elseif v:IsA("Folder") or v:IsA("Model") then updatetransparency(v,bool) end end end
local renderrrrrr = game:GetService("RunService").RenderStepped; script.Parent.MouseButton1Click:connect(function() if deb == "FPS" then if Player.Character then cam.CameraType = "Custom"; deb = "TPS" local char = Player.Character if char:FindFirstChild("Humanoid") then cam.CameraSubject = char.Humanoid script.Parent.Parent.PreviewFP.Text = "IN THIRD PERSON VIEW" cam.FieldOfView = 70 end updatetransparency(Player.Character) end elseif deb == "TPS" then if Player.Character then cam.CameraType = "Custom"; deb = "TPSHead" local char = Player.Character if char:FindFirstChild("Head") then cam.CameraSubject = char.Head script.Parent.Parent.PreviewFP.Text = "IN THIRD PERSON VIEW (HEAD FOCUS)" cam.FieldOfView = 70 end updatetransparency(Player.Character) end elseif deb == "TPSHead" then cam.CameraType = "Scriptable"; deb = "FPS" script.Parent.Parent.PreviewFP.Text = "IN FIRST PERSON VIEW"
- Assistant