is there a way to set the default walkspeed because i cant find anything and ive tried to script it but that only failed, because once the player died the speed reset(i had made a script that increases the speed but that speed gets reset on death) tested to disable the script after it runs once but that didnt work either so idk what to do
if game.Players.PlayerAdded then game:GetService("Players") game.Players.LocalPlayer.Character:WaitForChild("Humanoid") game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0 end script.Disabled = true
There is a much easier way to change the default WalkSpeed
that requires no code. To do this you must insert a Humanoid into StarterPlayer
and set the WalkSpeed
to whatever you like. Upon playing, the Humanoid
in StarterPlayer
will replace the default Humanoid
.
Hey there, there is actually a way to change the speed even if the user has respawned, it'll be showed in the following code;
Code:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local hum = char.Humanoid
hum.WalkSpeed = 0
end)
end)
Doesn't matter if it was in a Script or a LocalScript since it's speed but in this kind of scenario you will have to use Scripts.
Hope this helped.
Hello! I'm BlackOrange3343 and I'll be helping you today.
Let's restart.
- Insert a
Script
intoStarterCharacterScripts
(StarterCharacterScripts
is located inStarterPlayer
)
StarterCharacterScripts
is a place where each time the character is spawned, the script is cloned into the character and will run once. It automatically resets everytime you die.
- Now define the character and any variables you may need
local Char = script.Parent -- this is because the script is cloned into the character local Humanoid = Char:WaitForChild('Humanoid')
- Now Add the changing line
local Char = script.Parent -- this is because the script is cloned into the character local Humanoid = Char:WaitForChild('Humanoid') Humanoid.WalkSpeed = 0
And you're done!
Best of luck developer! Hope this helped.
BlackOrange3343
PS: Always learn the basics before making a game or failure will strike multiple times until the scripter gives up or fully restarts and learns the basics.