Checkpoint System

Hi, I’m always getting an error that says ChecpointNumber is nil…? Here is my code:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local CheckpointNumber = Player:FindFirstChild("CheckpointNumber")

local function onPartTouched()
	if CheckpointNumber.Value == 0 then
		CheckpointNumber.Value = CheckpointNumber.Value + 1
	end
end
4 Likes

local CheckpointNumber = Player:WaitForChild("CheckpointNumber") might fix your problem.

1 Like

Still caused the same error. 30 chars

Maybe check to see if you have any typos in the name. I noticed in the OP you typed “ChecpointNumber”, missing the ‘K’. If you did that anywhere in the code then it would throw that error.

1 Like

Does a IntValue or NumberValue exist in your player?

CheckpointNumber

1 Like

Yes, an intvalue in the player.

Strange, this behavior shouldn’t happen. Here I made a simple baseplate, check if it works out for you.

IntValueDemo.rbxl (18.3 KB)

1 Like