✓ Accepted answer
local Seat1 = workspace.Seat1
local Seat2 = workspace.Seat2
local Seat3 = workspace.Seat3
local playersSeated do
playersSeated=Instance.new("BindableEvent",script)
local players,debounce={},false
local function update(v,add)
local char=v.Part1.Parent
if add then
players[#players+1]=char
else
table.remove(players,table.find(players,char))
end
if #players==3 and not debounce then
debounce=true
local players=table.clone(players)
for i,char in ipairs(players)do
if i==#players then
debounce=false
end
local hum=char:FindFirstChildOfClass"Humanoid"
if not hum then continue end
hum.Jump=false
wait()
hum.Jump=true
wait(.1)
local msg,v=pcall(playersSeated.Fire,playersSeated,hum)
if not v then
warn(msg)
end
end
end
end
for _,v in ipairs{Seat1,Seat2,Seat3}do
v.Anchored=true
v.ChildAdded:Connect(function(v)update(v,true)end)
v.ChildRemoved:Connect(update)
end
end;
playersSeated.Event:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("HumanoidRootPart") then
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(0, 0.5, -14)
end
end)
1 comment
Seat1 and Seat2 and Seat3.Touched:Connect(function(hit) would probably only activate if all 3 were touched at the same time.