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

'attempt to compare string and number'. How to fix?

Here is my code. It is meant to work as a checkpoint system.

local checkpoint = script.Parent

checkpoint.Touched:Connect(function(otherPart)
	local partParent = otherPart.Parent
	local hum = partParent:FindFirstChildWhichIsA('Humanoid')
	if hum then
		local plrName = partParent.Name
		local plr = game.Players[plrName]
		local stage = checkpoint.Name
		if plr.leaderstats.Stage.Value >= stage then
		else
			plr.leaderstats.StageValue = stage
		end
	end
end)

1 answer

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