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

When I try to add WalkSpeed, I get a error, why?

	game.Workspace.Partyes.Touched:Connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") then
			plr.Character.Humanoid.WalkSpeed = +1
		end
	end)

this is in a player added script

1 comment

0

error: Expected identifier when parsing expression, got '+'

1 answer

✓ Accepted answer

You're adding it wrong, what you need to do is:

plr.Character.Humanoid.WalkSpeed = plr.Character.Humanoid.WalkSpeed+1

2 comments

0

when you want to add always restate the value of what you want to add after the = sign, if you put plr.Character.Humanoid.WalkSpeed = 1 then it would set the WalkSpeed to 1 instead of adding it

0

thank you

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