|
Mouse = Players:GetMouse()
function Jump(key)
if key == "h" then
game.Players.LocalPlayer.Humanoid.Jump
end
end)
Mouse.KeyDown:connect(Jump)
Error: Workspace.Player1.LocalScript:6: '=' expected near 'end'
Why should I put a "=" there that wouldn't make sense. |
|
|
It's because you never set a value, you can't just use .Jump
game.Players.LocalPlayer.Humanoid.Jump = true
r+://393244197r+://393244224r+://393244262 |
|
|
Take the parentheses off the last end. |
|
|
Thanks both of you fixed the problem. Did not think it is a boolean. |
|
|
Another problem occured.
Error: Workspace.Player1.LocalScript:1: attempt to index global 'Players' (a nil value)
It worked a few minutes ago, suddenly it doesn't |
|
|
If its not a boolean and its something like destroying something you have to use
:Destroy()
r+://393244197r+://393244224r+://393244262 |
|
|
add this to the top of the script
Players = game.Players.LocalPlayers
r+://393244197r+://393244224r+://393244262 |
|
|
Change line 1 to Mouse = game.Players.LocalPlayer:GetMouse() |
|
|
LocalPlayer*
not LocalPlayers
r+://393244197r+://393244224r+://393244262 |
|
|
Ah that's right I can't use "Players" If i dont declare it. Thx! |
|
|
Just one last question. If I want him to jump I need to use "Humanoid". But there is no humanoid in game.Players.LocalPlayer.Humanoid
And if I use Workspace for it it works, but I need to enter my players name. Can I generalize it so it works for all players? |
|
|
game.Players.LocalPlayer.Character.Humanoid
r+://393244197r+://393244224r+://393244262 |
|
|
Change it to game.Players.LocalPlayer.Character.Humanoid |
|
|
That completely fixed it! Your good at this, thanks alot!
|
|