The issue is, the thing wont even function at all when i click it. Basically what i'm trying to make is a "Contest" system. If you click the button, it will put your username in the table and change the "Participants:" text and will add your username in it too. It doesn't send errors or anything, it just doesn't function. Please fix, would be appreciated.
local ParticipantSign = game.Workspace.Participants.SurfaceGui.Text
local DatastoreService = game:GetService("DataStoreService")
local Participants = DatastoreService:GetDataStore("Participants")
local ParticipantsTable = {}
function OnClicked(player)
for i, v in pairs(ParticipantsTable) do
if v == player.Name then
print(ParticipantsTable.." nah you're in it")
return
else
Participants:GetAsync(player.Name)
table.insert(ParticipantsTable, player.Name)
print(ParticipantsTable.. " yes it worked")
ParticipantSign.Text = ParticipantSign.Text..player.Name..", "
end
end
end
script.Parent.ClickDetector.MouseClick:Connect(OnClicked)

1 comment
update: in line 14 even if i put table.insert(ParticipantsTable, player.Name), the button will still not function.