So i’m a little lost as to why this error is being spammed in the output, as it is working correctly but still spams the output with:
The print statement worked as well…
Here’s the code of this for loop:
for _,Checkpoint in pairs(Checkpoints:GetChildren()) do
if Checkpoint:IsA("BasePart") then
local Value = Instance.new("IntValue", Checkpoint)
Value.Value = Checkpoint.Name
Checkpoint.Touched:Connect(function(Hit)
local Player
local s, e = pcall(function()
Player = Players:GetPlayerFromCharacter(Hit.Parent)
end)
if s then
local Number = Checkpoint.Value.Value
if Player.Character:FindFirstChildOfClass("Humanoid").Health > 0 and Player.leaderstats.Stage.Value < Number and Player.leaderstats.Stage.Value == Number - 1 then
Player.leaderstats.Stage.Value = Number
print('worked')
end
end
end)
end
end
Line 110 is where the troubles are. Why perhaps is this happening and how can I fix it?