Im trying to make a Story Game Queue but its not working

  1. What do you want to achieve? Keep it simple and clear!
    I want to achieve is similar to the Hotel Story Queue
  2. 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.
  3. 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)

table.create(1, hit.Parent.Name)

I think this should be

table.insert(Table, hit.Parent.Name)

1 Like
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

Do you mean the value being displayed on the PlayerGui?
If that’s the case you will need to add some code to update the gui after Num.Text has changed

1 Like

No Its a Billboard GUI on a Part

change

not Numeral == Max

to
Numeral ~= Max

Thanks a Lot it worked :smiley:

1 Like