Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Im making obby and i have problem with this script. Do you guys know how to fix this?

game.Players.PlayerAdded:Connect(function(plr) local stage = plr:WaitForChild("leaderstats").stage plr.CharacterAdded:connect(function(char) repeat wait() until plr.Character ~= nil wait(0.01) local Checkpoint = game.Workspace.Stages:FindFirstChild(stage.Value) char:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(Checkpoint.Position +Vector3.new(0,5,0), Checkpoint.Position) char:FindFirstChild("HumanoidRootPart").Orientation = Vector3.new(0,0,0) wait(0.1) end) end)

stage is not a valid member of IntValue "Players.voffroad1.leaderstats" - Server - CheckPoints:2

1 answer

game.Players.PlayerAdded:Connect(function(plr)
	local stage = plr:WaitForChild("leaderstats").Stage -- I assume your stage capitalization is wrong. Consider changing the S to capital letter.
	plr.CharacterAdded:connect(function(char) 
	repeat 
		wait() 
	until plr.Character ~= nil 
	wait() 
	local Checkpoint = game.Workspace.Stages:FindFirstChild(stage.Value)
	char:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(Checkpoint.Position +Vector3.new(0,5,0), Checkpoint.Position) char:FindFirstChild("HumanoidRootPart").Orientation = Vector3.new(0,0,0) 
	wait() 
	end) 
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.