Hi again community,
Well, this time I have an script that when you press LShift the player starts to increase his max speed (if he's actual speed is less than 40) and the same for his animation (they're in the same loop).
while(player.Character.Humanoid.WalkSpeed < 40)do player.Character.Humanoid.WalkSpeed = player.Character.Humanoid.WalkSpeed + 4 runSpeed = runSpeed + 0.7 trackAnimation:AdjustSpeed(runSpeed) wait(0.5) end
The script works just fine, the problem appears when I run the game and press LShift this shows up on my output:
44: attempt to index upvalue 'player' (a nil value)
When I release the LShift Key shows up again.
I was ignoring it for now, but sometimes it just destroy the game because the speed and my animation get stucked and now I have a game with an animation in a loop and his max speed even if you're not even moving.
What am I missing here?
I really appreciate any help you can provide.
EDIT: 1) I don't know if the error comes from another line of code and its popping up there. 2) This is the way I get the player.
--// Services local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") --// Local Variables local player = Players.LocalPlayer
I think trackAnimation
is undiefined
Problem fixed.
I wasn't updating the plugin on-line. So the version I had on my Studio was crashing against the local one.
I've still have the animation and speed problem but I think that is more logical than something else.