I thought if I did that the player wouldn’t forcefully jump, sorry
No need to be sorry, but that is something I would surly test. Seems to me it is just what you’re looking for.
@2112Jay is right. If you have the player`s humanoid on the Server, you can just do:
local hum = plr.Character:WaitForChild("Humanoid")
hum.Jump = true
So you take your UIS part, and when true, you fire a RemoteEvent to the Server which fires this code
I used a LocalScript in StarterPlayerScripts to make the leaping ability, so do I need to rewrite the entire script from scratch, or I can reuse my current script and just modify it?
Edit: I misread the last part of your message by accident, woops…
Update: it works, the player now jumps and moves forward when leaping and looking forward, thanks guys!
Have to go to StarterPlayer and set CharacterUseJumpPower to true. Alt is messing with the interface so I went LeftControl. And we can skip the combo keys here by just using the jump key as is.
--local script
local player=game:GetService("Players").LocalPlayer
local humanoid=player.Character:WaitForChild("Humanoid")
local uis=game:GetService("UserInputService")
uis.InputBegan:Connect(function(input)
if input.KeyCode==Enum.KeyCode.LeftControl then
humanoid.JumpPower=120
end
end)
uis.InputEnded:Connect(function(input)
if input.KeyCode==Enum.KeyCode.LeftControl then
humanoid.JumpPower=50
end
end)
Basically you hold down LeftControl and you get more jump power.
Lol, I just scripted it rq for you. Well if you still need it:
LOCAL SCRIPT:
local player = game.Players.LocalPlayer
local userInputService = game:GetService("UserInputService")
local rep = game:GetService("ReplicatedStorage").RemoteEvent
local cooldownTime = 1
local onCooldown = false
local altPressed = false
local zPressed = false
local function startCooldown()
onCooldown = true
rep:FireServer()
wait(cooldownTime)
onCooldown = false
end
userInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl then
altPressed = true
elseif input.KeyCode == Enum.KeyCode.Z and not onCooldown then
zPressed = true
startCooldown()
end
end)
userInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl then
altPressed = false
elseif input.KeyCode == Enum.KeyCode.Z then
zPressed = false
end
end)
SERVER SCRIPT:
local rep = game:GetService("ReplicatedStorage").RemoteEvent
rep.OnServerEvent:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char.Humanoid
hum.JumpHeight += 100
hum.Jump = true
end)
Now you only need to add an RemoteEvent in ReplicatedStorage and itll work
EDIT: I also used LeftControl
But will it replicate to the server?
Semi-unrelated question, but the LocalScript that I made, will it show the player actually leap on everyone else’s ends or will it only be on the end of the person who has leaped?
my version will be shown to every player and the server, which is why I made a RemoteEvent. But Im not too sure about your solution
I tested with another person, and they said that it showed me leap, but just incase I will use your version xd, thanks again btw
Also, also, one more thing: Do I need to name the RemoteEvent anything specific?
You just have to keep it “RemoteEvent”
But it is using combo keys … meaning that is the only combination that will work. So you can’t super jump if you are also pushing forward or any other direction. Go test it … that changed my mind quickly about combo keys.
I meant like, looking forward, and the player leaping that direction.
I tested it and it still worked.
I ran it and that’s a nice set up. However it is not super jumping.
Love how you went to LeftControl too… lol, saw the same problem I take it.
hmm… It super jumped for me, albeit I am trying to restore the function where the player also gets pushed forward when looking forward, and only jumps up if looking up like in the older LocalScript
You’re definitely on to that forcing the jump in script should give you the control to do all that.
I’m not going to post a re-wright of your script. I think you got this covered if you add the rest to it.
Yeah, I already restored that function, no worries.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.