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

Im creating a obby and a peice of my checkpoint script isnt working?

function ot(hit)
if hit.Parent ~= nil then
local player = game.Players:playerFromCharacter(hit.Parent)
if player ~= nil then
if player.leaderstats.Stage.Value == script.Parent.Name - 1 then
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
if h.Health ~= 0 then
player.leaderstats.Stage.Value = script.Parent.Name
end end end end end end
?
script.Parent.Touched:connect(ot)

The output error says this Workspace.CheckPoints.Stage 2.Script:5: attempt to perform arithmetic on field 'Name' (a string value)

  • Stack Begin
  • Script 'Workspace.CheckPoints.Stage 2.Script', Line 5
  • Stack End

2 comments

0

https://scriptinghelpers.org/questions/965/checkpoints -- refer to that link in case you are in need of more assistance

0

Shouldn't you be using player.RespawnLocation? Just a thought.

2 answers

✓ Accepted answer

Hello Officer_DuckyC! Just rename the Script to the stage value, and make sure to remove ? at line: 11.

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