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

Why does my teleport a to the other seat that is taken script not work?

Asked by 4 years ago
Edited 4 years ago
local seat = game.Workspace.ArmyTruck.Seat
    local seat1 = game.Workspace.Seat1
    local seat2 = game.Workspace.Seat2
    local seat3 = game.Workspace.Seat3
    local seat4 = game.Workspace.Seat4
    local seat5 = game.Workspace.Seat5
    local seat6 = game.Workspace.Seat6
    local seat7 = game.Workspace.Seat7
    local seat8 = game.Workspace.Seat8

    if seat.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat.CFrame + Vector3.new(0,3,0)
    elseif seat1.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat1.CFrame + Vector3.new(0,3,0)
    elseif seat2.Occupant == nil then
    char.UpperTorso.CFrame = game.Workspace.Seat2.CFrame + Vector3.new(0,3,0)
    elseif seat3.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat3.CFrame + Vector3.new(0,3,0)
    elseif seat4.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat4.CFrame + Vector3(0,3,0)
    elseif seat5.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat5.CFrame + Vector3.new(0,3,0)
    elseif seat6.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat6.CFrame + Vector3.new(0,3,0)
    elseif seat7.Occupant == nil then
        char.UpperTorso.CFrame = game.Workspace.Seat7.CFrame + Vector3.new(0,3,0)
    elseif seat8.Occupant == nil then 
        char.UpperTorso.CFrame = game.Workspace.Seat8.CFrame + Vector3.new(0,3,0)

    end

So if Seat is taken, i want the player to get teleported to Seat1.

But when Seat is seated by a player, the next player, who is supposed to teleport to Seat1, also teleports to Seat. Seat is just a seat in the Workspace and so it Seat1. I get no errors.

0
simple - u get the player to sit on the other player's lap TheluaBanana 946 — 4y

Answer this question