What do you want to achieve? Keep it simple and clear!
I want to achieve is similar to the Hotel Story Queue
What is the issue? Include screenshots / videos if possible!
I made a script that adds a player to a table when they go in a block they get added to the queue, but when they touch it, it doesn’t do anything.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked all over youtube of how to make a queue but they are all making something thats different to what I want to make
local Table = {}
local Max = 9
local Numeral = 0
local Queue = script.Parent.Queue
local Num = Queue.Frame.Numeral
local function CheckTable(object)
if table.find(Table, object.Name) then
return true
else
return false
end
end
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if CheckTable(hit.Parent) == false and not Numeral == Max then
Numeral = Numeral +1
Num.Text = Numeral.."/"..Max
table.create(1, hit.Parent.Name)
else
print("doesnt count")
end
end
end)
wait(5)
local Table = {}
local Max = 9
local Numeral = 0
local Queue = script.Parent.Queue
local function CheckTable(object)
if table.find(Table, object.Name) then
return true
else
return false
end
end
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if CheckTable(hit.Parent) == false and not Numeral == Max then
local Num = script.Parent.Queue.Frame.Numeral
Numeral = Numeral +1
Num.Text = Numeral.."/"..Max
table.insert(Table, 1, hit.Parent.Name)
else
print("doesnt count")
end
end
end)
That does for adding something to the table, BUT it doesn’t add something to the numeral value