What does this script supposed to do - when a child is added in the workspace, it will check the class name of it, if its a model then it will get the player using it, then it will get the value of the stage in the leaderstats of the player then it will find a part from game.workspace.checkpoints(folder) that is named same as the value of the stage in the leaderstats of the player then it will get it's cframe and move the humanoidrootpart of the obj(character) and move it 12 studs up.
game.Workspace.ChildAdded:Connect(function(obj) if obj.ClassName == "Model" then local player = game.Players:GetPlayerFromCharacter(obj) local target = game.Workspace.CheckPoints:FindFirstChild(player.leaderstats.Stage.Value) obj.HumanoidRootPart.CFrame = target.CFrame + Vector3.new(0,12,0) end end)
the error is that instead of finding the part with the name same as the value of the stage, it tries to find the STAGE in that folder
20:16:37.289 - Stage is not a valid member of Folder 20:16:37.290 - Stack Begin 20:16:37.291 - Script 'ServerScriptService.Script', Line 4 20:16:37.292 - Stack End
UPDATE - i found the error, so in the script where i made the leaderstats apparently it was lowercase "s" so i made it uppercase now it works, BUT not just yet, it doesn't teleport me to the right spot, i used print to see the cframe and it was right but it still doesn't teleport me to the right spot? i tried removing the vector3 but still doesn't work.
Maybe try this
game.Workspace.ChildAdded:Connect(function(char) if char:IsA("Model") then local stage = player.leaderstats:WaitForChild("Stage").Value local target = workspace.CheckPoints:FindFirstChild(stage) char.HumanoidRootPart.CFrame = target.CFrame + Vector3.new(0,12,0) end end)