![]() |
Player Speed
I'm really just wanting ideas on the best, most effecient ways to slow down a player using default movement.
I know you can get better results with this sort of stuff on custom movement, but I need it for something else. I tried to do the opposite of "staff boots" style and got a butload of callstack errors... so some ideas if someone wouldn't mind? And I'm not asking you to do it for me, just need a different point of view to approach it, either my brain is racked or I'm just too focused in a bad way lately... Thanks you. |
I haven't done it myself, but you should be able to just adjust player.defaultwalkspeed and player.diagonalwalkspeed. v6 only.
|
Just tried defaultwalkspeed, pretty cool.
just to add it seems the defaults are: player.defaultwalkspeed = 0.5; player.diagonalwalkspeed = 1; in case anyone comes directed here from search and doesn't know...not that it's too difficult to find out though either... What about while swimming though? It's the only other "movement" that is rarely touched... I know I can disable movement in a timeout with water check, then just watch keys and move the player, but the way I script I try to do everything to avoid a continous timeout if I can, so I was hoping there was another way. |
I suppose something like this?
PHP Code:
|
Quote:
Tho I guess this is better then servers simply giving you level 3 shield just to make you run faster. |
Quote:
I'm wondering if there is a better way than that though, as I hate using timeouts... |
Quote:
|
Quote:
PHP Code:
|
Quote:
Basically I'm just trying to stay away from the typical: if player in water timeout>timer disabledefmovement if(dir keys) player.x/y +- I really don't want to have to disabledefmovement if there is another logic to slowing down a player if they are in water/swimming. I tried player.x/y -+= 0.001 and got callstack errors and loop exceeding limits. I could avoid that only moving the x/y onkeypressed I suppose but was just hoping there was a different logic I could approach (like me not even knowing player.defaultwalkspeed was there). |
If you're getting loop limit errors, you're doing something wrong. Post your code?
I don't know what the problem is or if timeouts are necessary in this case, but there's no reason to have such an extreme aversion to timeouts as long as you're not doing too much in them—sometimes you just can't avoid them. |
Can you not just alter player.defaultwalkspeed while swimming and switch it back when they're not in water?
|
Quote:
Quote:
|
Quote:
|
xD
God knows what I did but it works lol. Sry. Fer real. The onwater check I have wouldn't work, but player.swimming does... PHP Code:
|
| All times are GMT +2. The time now is 03:54 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.