#i need help this doesnt work its suppossed to teleport users into the seats force them to exit
39 messages · Page 1 of 1 (latest)
Wait can you describe what you're trying to do again with the code?
Because it seems like you're describing like a player teleport in a single game
because most of the code doesn't match what I think you're trying to say in the description
Ngl this post kinda relieves me because it shows I won't get replaced just yet by AI unless the text input was kinda messy
heheh
bro
poorly made code
IT LITERALLY TELEPORTS TO ANOTHER GAME
INSTEAD OF TELEPORTING TO THE SEAT
At least we can flame the AI instead XD
So technically
it ain't his fault
Lets just make fun of the AI
Don't use AI for programming just yet lol
How to make it so it automatically put 6 players into the seats and prevent them from leaving the seats?
So if those 6 players are already selected what you can do is have a table or some sort of list for the seats and then go through the players you have selected and use the Sit() method for a seat to make the player sit on it
Sit () method has an arg for a humanoid
And to like prevent them from leaving
you can call the SetStateEnabled method of like the humanoid of the current player you trying to sit
and do something like thos
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
btw fucking hate phones rn
can't so that dot thing to format this and make it look nicer
You could use the A.I. in programming as long as you know a little programming so you know if the A.I. made you the script you want or some random s**t like the OP did
Eh yeah that's why I said just yet welp
i tried to use this script
-- Define the seats as variables
local seats = {
game.Workspace.S1,
game.Workspace.S2,
game.Workspace.S3,
game.Workspace.S4,
game.Workspace.S5,
game.Workspace.S6
}
-- Define a function to check if a seat is occupied
local function isSeatOccupied(seat)
for _, child in ipairs(seat:GetChildren()) do
if child:IsA("Humanoid") then
return true
end
end
return false
end
-- Define a function to put a player in a seat
local function putPlayerInSeat(player, seat)
-- Create a new humanoid for the player
local humanoid = Instance.new("Humanoid")
humanoid.Parent = player.Character
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
-- Move the player to the seat
player.Character:SetPrimaryPartCFrame(seat.CFrame)
end
-- Define a function to force all players into seats
local function forcePlayersIntoSeats()
local players = game.Players:GetPlayers()
for i, seat in ipairs(seats) do
if i > #players then
break
end
local player = players[i]
if not isSeatOccupied(seat) then
putPlayerInSeat(player, seat)
end
end
end
-- Call the function once at the start of the game to force players into seats
forcePlayersIntoSeats()
-- Define a function to prevent players from leaving their seats
local function preventPlayersFromLeavingSeats()
for _, player in ipairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
for _, seat in ipairs(seats) do
if seat:IsDescendantOf(character) and not isSeatOccupied(seat) then
putPlayerInSeat(player, seat)
end
end
end
end
end
-- Call the function repeatedly to prevent players from leaving their seats
game:GetService("RunService").Stepped:Connect(preventPlayersFromLeavingSeats)
the script and seats are suppossed to be in workspace
and it still doesnt work