As the title states: I am trying to find out how can I find the player's humanoid on a server sided script?
I want to change the WalkSpeed and the JumpPower of the player that fired the event.
My script:
game.ReplicatedStorage.DialogEnd.OnServerEvent:Connect(function(player) game.ReplicatedStorage.DialogEnd.OnServerEvent:Connect(function(character) player.character.Humanoid.WalkSpeed = 16 player.character.Humanoid.JumpPower = 50 end) end)
P.S. Still learning how to code, so apologies about my rookie mistakes.
see if this helps you out
game.ReplicatedStorage.DialogEnd.OnServerEvent:Connect(function(player) player.Character.Humanoid.WalkSpeed = 16 player.Character.Humanoid.JumpPower = 50 end)
the remote event ONLY pass the player instance, not the character instance, unless the local script pass the char through a second argument
something like this
local plr = game.Players.LocalPlayer local char = plr.Character game.ReplicatedStorage:FindFirstChild("DialogEnd"):FireServer(char) -- always use find first child when firing a remote event that's not a descendant of the local script
then this:
game.ReplicatedStorage.DialogEnd.OnServerEvent:Connect(function(player,char) char.Humanoid.WalkSpeed = 16 char.Humanoid.JumpPower = 50 end)
would work, because you're now passing the character argument through the local script, see more about remote events at: https://developer.roblox.com/en-us/api-reference/class/RemoteEvent
hope this helps