You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to make a part where players touch and only 2 players will be shown a GUI. The problem is I’m not sure how to do this, I’ve tried using debounces so no more players can touch it. Now I’m thinking of adding players to a table instead.
- What is the issue? Include screenshots / videos if possible!
I want to get the first player who touches the part and then add their name to the “captains” table.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried looking online for resources including the dev forum but couldn’t find anything to help me.
Here is my code thanks.
-- This is an example Lua code block
local captains = {}
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
end
end)