local p = script.Parent
function onTouched(hit)
local c = game.Players:GetPlayerFromCharacter(hit.Parent)
if c then
game.Players.c.Stage.Value = 1
end
end
p.Touched:connect(onTouched)
script.Parent is a part with the name "Stage 1", which is a child of the model "StageNotifiers". This model is a child of the Workspace.
This script is (supposed to) set the leaderstat value of "Stage" to 1. I then will be copying this script into the part "Stage 2", located in the same model, changing the value inside of the script to "2", etc.
The purpose of this script is for an obstacle course that I'm working on.
Current error: "c is not a valid member of Players"

1 comment
Answered. Thanks!