So i was trying to make a local script which would make the character jump on left click using context action service.
i set it up to use Humanoid.Jump = true, but when i came to running it, it didn’t work, and there were no errors. Then i set it up the same way again but using a remote event to request the server to set the jump to true, and it worked that way. Then when i opened the dev hub, it stated that humanoid.jump was not replicated across the client server boundary.
I need the character to jump instantly on click, and for there to be no lag, so is there any other method to make the character jump locally?
--Local Script
local contextActionService = game:GetService("ContextActionService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local char = player.Character
contextActionService:BindAction("JumpClick", function(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.Begin then
player.Character:FindFirstChildOfClass("Humanoid").Jump = true
replicatedStorage.Remotes.JumpCick:FireServer()
end
end, false, Enum.UserInputType.MouseButton1)```
--ServerScript
local replicatedStorage = game:GetService("ReplicatedStorage")
replicatedStorage.Remotes.JumpClick.OnServerEvent:Connect(function(plr)
plr.Character:FindFirstChildOfClass("Humanoid").Jump = true
end)
setting the humanoid jump to true didnt seem to work for him, But my alternative does.
Plus I’ve also read reports about setting it to true client-sided didn’t seem to work (I am not sure of this though)
edit: if my method works for you, maybe mark my method as your solution unless you still need help yes?
Can you explain why setting Humanoid.Jump to true didn’t seem to work for him but why did Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) seem to work?
how about check FloorMaterial property? If it’s air don’t allow humanoid to jump. Sorry for late answer, but maybe there still some people out there who need the answer