Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

OnTouch, wot am i doing wrong?

Asked by
xNurr 0
10 years ago

I Was trying to use the "OnTouch" function. And heres what i did.

game.Workspace.xNurr = z function OnTouch z.Humanoid.WalkSpeed = 100 z.Humanoid.MaxHealth = math.huge end

"z.Humanoid.WalkSpeed = 100" the letter z has a red line under it, what's wrong?

1 answer

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

Your problem is the line

game.Workspace.xNurr = z 

When defining variables, the variable's name comes first, and the variable's value comes second.

You therefore simply need to reverse that line, i.e.

z = game.Workspace.xNurr
Ad

Answer this question