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
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
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
Btw it is better to do indentation in the script, I’m on mobile so I can’t press tab sorry :(
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
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
Select StarterPlayer in the explorer.
Change CharacterWalkSpeed to 100, and CharacterJumpPower to 100.
You can easily do this in Game Settings. Just change the player speed and jump to 100.
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
you gotta define the player in the parameters
it still doesnt work game.Players.PlayerAdded:Connect(function(player) game.Workspace.Character.Humanoid.WalkSpeed = 100 game.Workspace.Character.Humanoid.JumpPower = 100 end)
That still won't work, because you're defying player for a reason. You need to use that player argument for Character.