hello! my script was working the other day. it would give a random seat and plate to a player but it would give say eg. Plate1 and Seat1 to the player which is what i wanted but now it has changed.
it gives a completely different plate to the player. (there are 20 plates and 20 seats)
eg:
script:
local M6D:Motor6D = nil
local randomSeat:Seat = nil
local randomPlate = nil
local randomNo = Random.new():NextInteger(1, 20)
function startGameModule.startGameFunction()
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAppearanceLoaded:Connect(function(c)
wait()
local seatOFFSET=CFrame.new(0,2,0)
local seatFolder = workspace.tableModel.seatFolder
local plateFolder = workspace.tableModel.plateFolder
local hum:Humanoid = c.Humanoid
randomSeat = seatFolder:GetChildren()[randomNo]
randomPlate = plateFolder:GetChildren()[randomNo]
print(randomSeat)
print(randomPlate)
if randomSeat:GetAttribute("occupied") == false then
c:PivotTo(randomSeat.CFrame* seatOFFSET)
wait()
randomSeat:Sit(hum)
randomPlate.Parent = c
M6D.Part1 = randomPlate
if randomSeat.Occupant then
randomSeat:SetAttribute("occupied", true)
randomSeat:SetAttribute("playerName", randomSeat.Occupant.Parent.Name)
randomPlate:SetAttribute("playerName", randomSeat.Occupant.Parent.Name)
randomPlate:SetAttribute("occupied", true)
c:SetAttribute("sitAttribute", true)
end
end
end)
end)
end