So my script makes it so only one person can see the objects when they are cloned. It works perfectly find in studio, but once I tried it in Roblox Player, nothing happened. I checked the developer console and no errors.
Nothing else is touching the button besides the player, I have no clue why it's not working. If you see something in here that could cause the game to stop working when touched in Roblox Player, then please reply what it is and the solution to fix it :)
local buttonPressed = false game.Workspace.SkeletonRun.Touched:Connect(function(hit) if not buttonPressed then buttonPressed = true local obj = game.ReplicatedStorage:WaitForChild("Objects") local plr = game.Players.LocalPlayer if(game.Players:GetPlayerFromCharacter(hit.Parent)==plr)then obj:Clone().Parent = workspace hit.Parent.Humanoid.WalkSpeed = 0 hit.Parent.Humanoid.JumpPower = 0 plr.CameraMinZoomDistance = 0 plr.CameraMaxZoomDistance = 0 wait(1) hit.Parent.Humanoid.WalkSpeed = 65 wait(1) buttonPressed = false end end end)