SO basically im making a game with guns and i made it so you cant jump because i think its cheap dodging and i want to make cars, so i used the old car model made by roblox because I dont trust any model unless roblox trusts it or its made by them https://web.roblox.com/library/59524676/Car so pls help idk what to do
Make the jump power really small, like 0.1 or something, other than that I do not really know how to help you.
Hello there! This seems like a fairly simple problem to fix.
While you're sitting in the car, you can set the player's JumpPower
to 16 (default value), like so. (Put the script inside the VehicleSeat
)
local Players = game:GetService("Players") seat:GetPropertyChangedSignal("Occupant"):Connect(function() local char = seat.Occupant.Parent -- The character of the player that is sitting in the seat end)
Now that we've done that, we just have to set the player's JumpPower
to 16!
local Players = game:GetService("Players") seat:GetPropertyChangedSignal("Occupant"):Connect(function() local char = seat.Occupant.Parent -- The character of the player that is sitting in the seat char.Humanoid.JumpPower = 16 -- Setting Player's JumpPower end)
Now that's fine and dandy, but you have to set the JumpPower
to 0, when you leave the seat.
Don't worry! We can just add a simple if
statement!
local Players = game:GetService("Players") local char -- This variable has been moved outside to make it global. seat:GetPropertyChangedSignal("Occupant"):Connect(function() -- Moved above if seat.Occupant ~= nil then char = seat.Occupant.Parent char.Humanoid.JumpPower = 16 else char.Humanoid.JumpPower = 0 -- This will work because the old occupant will be the current "char" variable end end)
Anyway, I hope my explanation was helpful! If there are any problems, just leave a comment!
You could say:
humanoid.JumpPower = 0;
That would do the job fine. Although, I think it's cleaner and better to use Humanoid:SetStateEnabled()
Here is how you use it:
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false);
You Could do like ProvingTrottle , or just set jump power to 0.1
Closed as Too Broad by DeceptiveCaster
This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.
Why was this question closed?