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

how to make it so that if the player joined the game his speed and jump is 100?

Asked by 3 years ago

this code isnt working local SpeedGiver = game.Workspace

game.Players.PlayerAdded:Connect(function() game.Workspace.Character.Humanoid.WalkSpeed = 100 end)

i just dont understant what parent does the character have

0
you gotta define the player in the parameters acediamondn123 147 — 3y
0
it still doesnt work game.Players.PlayerAdded:Connect(function(player) game.Workspace.Character.Humanoid.WalkSpeed = 100 game.Workspace.Character.Humanoid.JumpPower = 100 end) crushersxd 15 — 3y
0
That still won't work, because you're defying player for a reason. You need to use that player argument for Character. 2_MMZ 1059 — 3y

5 answers

Log in to vote
0
Answered by
7777ert 49
3 years ago
Edited 3 years ago

You got to tell the script which player’s character is it! To do this, you can try the script below:

game.Players.PlayerAdded:Connect(player)
player.character.Humanoid.WalkSpeed = 100
player.character.Humanoid.JumpPower = 100
end

In the script, player is a parameter of the event PlayerAdded. It will tell the server ‘who’ joined the game. Then, after knowing who joined, the script will find the player’s character and change his walkpower and jumppower to 100

Hope I make it clear :D

0
Btw it is better to do indentation in the script, I’m on mobile so I can’t press tab sorry :( 7777ert 49 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

put a script inside ServerScriptService then the code should look like this:

game.Players.PlayerAdded:Connect(function(player) -- gets the player when they join
    player.CharacterAdded:Connect(function(character) -- wait till the character loaded

        local humanoid = character:WaitForChild("Humanoid") -- define humaoid
        humaoid.WalkSpeed = 200 --  change it, walkspeed :)
        humanoid.JumpPower = 200 -- change it, jumppower
    end)
end)

hope i helped LOLLOLOLO

Log in to vote
0
Answered by 3 years ago

Depending on whether or not you want to achieve this through a script, this can vary. For a less complex version, you would just go into starterCharacterScritpts, and change the walk speed/jump power. Although, I recommend doing this through script, because you can later change or adjust the speed, and or jump power. Put this script into the server script service, as a script:

game.Players.PlayersAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
    local hum = char:WaitForChild("Humanoid") 
    local w = hum.WalkSpeed 
    local j = hum.JumpPower
    w = nil -- put your walkspeed here (default is 16)
    j = nil -- put your jump power here 
    end)
end)

This should work just fine, and if you want to tie this to a remote event, or a touched function, your free to ask

Log in to vote
0
Answered by
Aeventy 20
3 years ago

Select StarterPlayer in the explorer.

Change CharacterWalkSpeed to 100, and CharacterJumpPower to 100.

Log in to vote
0
Answered by 3 years ago

You can easily do this in Game Settings. Just change the player speed and jump to 100.

Answer this question