I am having a problem with my checkpoint script. As my title said. I am trying to make my obby so when a player touches a checkpoint it dissapears. But when i test the game with 2 players when the first one touches the checkpoint for the other one it is invisible and the checkpoint stops working for the first one. What i want to do is for each player to have their own script. I am new to scripting lua c on roblox.
Here is my script:
local StageValue = 0
local debounce1 = false
local Touched1 = false
workspace.Stages.Stage1.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") and not debounce1 and not Touched1 then
Touched1 = true
StageValue = StageValue + 1
if StageValue == 1 then
print("StageValue is now 1")
workspace.Stages.Stage1.CanCollide = false
workspace.Stages.Stage1.Transparency = 1
workspace.Stages.Stage1.Sparkles.Enabled = false
local debounce1 = true
end
end
end)
This is all in a script not a local script and the script is located in the workspace.

2 comments
Local programs operate on the Client machine, whilst Server (regular) Scripts run on the ROBLOX Server. The Server, as all Servers, manage all Clients, meaning any action performed through a ServerScript will occur for everyone. Use a LocalScript to solve this issue.
I did... BUT the script did not work.