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

(Solved) I'm trying to increase the player's walkspeed and jumppower. What am I doing wrong?

Asked by 5 years ago
Edited 5 years ago

Here's the code block

local Players = game:GetService("Players")
local plr = game.Players.LocalPlayer

wait(1)
Players.PlayerAdded:Connect(function(player)
    plr.Character.Humanoid.WalkSpeed = 32
    plr.Character.Humanoid.JumpPower = 60
end)
0
Could be due to the fact that you're using 'game.Players.LocalPlayer' in what should be a normal script, not a local script. namespace25 594 — 5y
0
Oh Shaablowski -1 — 5y

2 answers

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

This will fix it.

game.Players.PlayerAdded:Connect(function(player)
    repeat wait() until player and player.Character
        delay(1, function() 
        local h = player.Character.Humanoid
        h.WalkSpeed = 32;
        h.JumpPower = 60;   
    end)
end)
0
Worked perfectly! Thanks! Shaablowski -1 — 5y
0
You're welcome. namespace25 594 — 5y
Ad
Log in to vote
0
Answered by
brok4d 77
5 years ago

And it uses a Server Script, not a LocalScript.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
        player.CharacterAdded:Connect(function(character)
        character.Humanoid.WalkSpeed = 32
            character.Humanoid.JumpPower = 60
    end)
end)
0
I inserted the server script in both StarterCharacterScripts and Workspace and both did not work. Shaablowski -1 — 5y
0
ServerServiceScript brok4d 77 — 5y

Answer this question