While the character is in the middle of walking, I have this script run:
Plyr = game.Players.LocalPlayer.Character.Humanoid Plyr.StateChanged(None):connect(function() script.Disabled = true end)
But when it tries to run, it just gives the error: attempt to call field 'Running' (a userdata value) (line 1).
What is wrong with this?
What this looks like to the Lua interpreter is you are attempting to call the 'StateChanged' member of the Humanoid with the argument 'None', which is nil in this context, and then call the result's 'connect' method. Since StateChanged is an Event and not a Method, this breaks there.
What I assume you meant, is you want this to fire when the State changes to 'None':
Plyr = game.Players.LocalPlayer.Character.Humanoid Plyr.StateChanged:connect(function(state) if state == Enum.HumanoidStateType.None then script.Disabled = true end end)
StateChanged event is a member of the Humanoid, and cannot be used with the player. At least I don't think it can. http://wiki.roblox.com/index.php?title=StateChanged_(Event)