I have tried the below and there is an error to getting it to get the last number or something like that. Any help?
local booth = game.Workspace.CreditBooth.Board
local player = game.Players.LocalPlayer
local items1 = {booth.Side1.Credits:WaitForChild("10Credits"),booth.Side2.Credits:WaitForChild("10Credits"),booth.Side3.Credits:WaitForChild("10Credits"),booth.Side4.Credits:WaitForChild("10Credits")}
for _, v in pairs (items1) do
v.MouseButton1Click:connect(function()
local num = tonumber(string.sub(v, string.len(v))) -- Error is here.
local parentnum = tonumber(string.sub(v.Parent, string.len(v.Parent)))
if num == 1 and parentnum == 1 then
elseif num == 1 and parentnum == 2 then
end
end)
end
Players.Player.PlayerGui.CreditBoothScript:11: bad argument #1 to 'len' (string expected, got userdata)

3 comments
i was thinking about a for loop, but I need to be real shprt
I have editted my answer with your one, but there is an error. I changed it a bit to how I would like it. I have output and all
nvm, i solved it thanks :D