Hello developers!
So I’m not a very good scripter I mostly build I know some scripts like 10 maybe
So I don’t know how to fix this my script is
function hello()
print(“Player Has Entered The Queue”)
end
game.Workspace.Queue.Touched:Connect(hello)
so the problem is that I want to make this script so a player can only step on this once for the message to happen I don’t want them to be able to step on it as many times they want
an easier way to say it: I don’t want the player to activate the script once they have stepped on the block already
You can get the player who touched the script, add their name to a table, and whenever a part touches the brick, check if they are not in the table. If they are, ignore it. If they aren’t, add them to the table and continue with the function.
Alternatively you can insert a BoolValue inside the player when they join, and set the value to true when they have touched the brick
local PlayersinQueue = {}
game.Workspace.Queue.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if not table.find(PlayersinQueue, hit.Parent.Name) then
table.insert(PlayersinQueue, hit.Parent.Name)
print(hit.Parent.Name.." has been added to the queue!")
end
end
end)