Hello there. I am trying to make a difficulty chart obby and I am trying to make my own checkpoint system. I cannot figure out why on line 6 it outputs 'attempt to compare string and Instance'. Also, I need a little help moving a character to a checkpoint after they die. Here is my code.
script.Parent.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChild('Humanoid')
if h ~= nil then
local chr = hit.Parent
local plr = game.Players[chr.Name]
if plr.leaderstats.Stage >= script.Parent.Name then
else
plr.leaderstats.Stage = script.Parent.Name
end
end
end)

2 comments
Is the stage value that you're using is a Number Value?
Stage.Value, "attempt to compare string and instance" means that stage is an instance and script.Parent.Name is a string. Solution: Stage.Value lines 8 and 6