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

Stop walkspeed resetting on Death?

Asked by
Ben_B 9
4 years ago

Would I need to add a remote event + charadded as ive tried with Charadded and it does not work, thanks.

while true do
    wait()
    local player = game.Players.LocalPlayer
local value = player:WaitForChild("WalkspeedShop").W20.Value
local value2 = player:WaitForChild("WalkspeedShop").W23.Value
local value3 = player:WaitForChild("WalkspeedShop").W25.Value
local value4 = player:WaitForChild("WalkspeedShop").W26.Value
local value5 = player:WaitForChild("WalkspeedShop").W27.Value
local value6 = player:WaitForChild("WalkspeedShop").W28.Value
local value7 = player:WaitForChild("WalkspeedShop").W29.Value
local value8 = player:WaitForChild("WalkspeedShop").W30.Value

if value8 == true then
    player.Character.Humanoid.WalkSpeed = 30
    break
elseif value7 == true then
    player.Character.Humanoid.WalkSpeed = 29
    break
    elseif value6 == true then
    player.Character.Humanoid.WalkSpeed = 28
    break
    elseif value5 == true then
    player.Character.Humanoid.WalkSpeed = 27
    break
    elseif value4 == true then
    player.Character.Humanoid.WalkSpeed = 26
    break
    elseif value3 == true then
    player.Character.Humanoid.WalkSpeed = 25
    break
    elseif value2 == true then
    player.Character.Humanoid.WalkSpeed = 23
    break
    elseif value == true then
    player.Character.Humanoid.WalkSpeed = 20
    break
end


0
explain more :v Necro_las 412 — 4y
0
Hmm Where Did You Place The Script? crueluu 169 — 4y
0
In StarterGui Ben_B 9 — 4y
0
Try using the CharacterAdded event and have all the meat of your code in there. If im not mistaken, the character loads in again after death triggering the function. Audiimo 105 — 4y
0
Thank you ill try that Ben_B 9 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You could probably get the players WalkSpeed every time you change it then put it back on them after they die.

Ad

Answer this question