Is there any code anyone can send me to keep my players in their seat for a specific amount of time and then when I chose they can jump out their seat?
We can use Humanoid:SetStateEnabled
and Seat:GetPropertyChangedSignal
to achieve this.
local seat = path.to.Seat -- please change path.to.seat to your seat, HAS TO BE A Seat Instance seat:GetPropertyChangedSignal("Occupant"):Connect(function() -- get the event signal and connect it to the function local occupant = seat.Occupant -- get the humanoid of the occupant!! if occupant then -- if there is a occupant local p = game:GetService("Players"):GetPlayerFromCharacter(occupant.Parent) -- get the player from the parent of humanoid if p then -- if there is a player then occupant:SetStateEnabled(Enum.HumanoidStateType.Jump, false) -- disable jumping. wait(0) -- change 0 to your time you want to wait. occupant:SetStateEnabled(Enum.HumanoidStateType.Jump, true) -- enable jumping end end end)
Please mark this as a solution if this works in your context, Metatable out!
Name= "Put in Username"
game.Workspace:FindFirstChild(Name).Humanoid.UseJumpPower=false
game.Workspace:FindFirstChild(Name).Humanoid.JumpHeight=0
wait(5)
game.Workspace:FindFirstChild(Name).Humanoid.UseJumpPower=true
game.Workspace:FindFirstChild(Name).Humanoid.JumpHeight= Your Original JumpHeight
you have to change the script to make it do what you said.
what this script does: it disables the JumpPower (The Player has to be seated) and then after 5 Sek it Turns it on Again.
Closed as Not Constructive by Nguyenlegiahung, FunctionalMetatable, Dovydas1118, and Leamir
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?