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

How can I save a walkspeed permanently?

I made a gmae where you can buy speed for cash. You can buy speed, but if you die, your speed is set to 0. Also, if you leave, you walkspeed is reset. Here is my level 1 speed script:

local players = game.Players.LocalPlayer	
script.Parent.MouseButton1Click:Connect(function(Click)   
	if players.leaderstats.Cash.Value >= 1 then
		players.leaderstats.Cash.Value -= 1

		players.Character.Humanoid.WalkSpeed = 21
		thews = 21
	end
end)

players.CharacterAdded:Connect(function(c)
	c:WaitForChild("Humanoid").WalkSpeed = thews
end)


local players = game.Players.LocalPlayer	
script.Parent.TouchTap:Connect(function(Click)   
	if players.leaderstats.Cash.Value >= 1 then
		players.leaderstats.Cash.Value -= 1

		players.Character.Humanoid.WalkSpeed = 21
		thews = 21
	end
end)

players.CharacterAdded:Connect(function(c)
	c:WaitForChild("Humanoid").WalkSpeed = thews
end)

Is there something I can add that makes this permanent if they buy this? All help is appreciated!

1 answer

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