Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making it so player can't jump out of the seat once they are in it?

Asked by 5 years ago
local seat = workspace.Seats.Seat10
seat.Changed:connect(function(property)
    if property ~= 'Occupant' then return end

local occupant = seat.Occupant
    if occupant then
        local character = occupant.Parent
        local player = game.Players:GetPlayerFromCharacter(character)
        local Humanoid = occupant.Parent:WaitForChild("Humanoid")
        if player then
    Humanoid.JumpPower = 0;
    wait(180) -- however long the round is
    Humanoid.JumpPower = 50
    else
        print("Someone left the seat")
    end
end)
0
You're missing an end. Add one above the "end)". User#20279 0 — 5y
0
Use Advanced Objects and search Seat instead of a script like this. cherrythetree 130 — 5y

Answer this question