Can somene help me about the problem that im having now because i tried to make slow effect in my script and i make for example -10 Walkspeed and for 2 sec i want it to back the normal walkspeed i try to make this for example:
player.Parent.Humanoid.WalkSpeed = -10 wait(2) player.Parent.Humanoid.Walkspeed = 16
but this code will make the npc more fast and i want it to back there normal walkspeed for example npc only have 10 Walkspeed and it will back the 10 normal speed but if the code is like my example it will make him +6 faster so does anyone know about a code that make player or npc back there normal speed?
If you just wanted it to go back to the default walkspeed you gave it earlier, then why not try this code:
local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:wait() Character.Humanoid.Walkspeed = 1 --I think setting it to a negarive value will remove the npc's ability to walk wait(2) Character.Humanoid.Walkspeed = 10
to incorporate this into a tool or something use a touch function
--Let's say you would like to incorporate it in a magic power you just scripted script.Parent.Touched:Connect(function(hit) local Humanoid = hit.Parent:findFirstChild("Humanoid") if Humanoid then Humanoid.Walkspeed = 1 wait(2) Humanoid.Walkspeed = 10 end end)
If this does not answer your question, please do leave a comment saying that it didn't with an elaboration of the problem. Thanks!
Thanks for anyone who answer my question and it give me some clue now i already fix it and it help me a lot for giving me a clue thank you guys