Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Stop walkspeed resetting on Death?

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


5 comments

0

explain more :v

0

Hmm Where Did You Place The Script?

0

In StarterGui

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.

0

Thank you ill try that

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.