When you press a agent and on LOCK IN then that you pick a agent and no one else can pick him.
This is my code:
local plat = "TEST1"
local plat2 = "TEST2"
while true do
wait(1)
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Visible = false
if game.Workspace:WaitForChild("TestC") then
print("A player has picked ".. plat .. " (locked)")
elseif game.Workspace:WaitForChild("TestC2") then
print("A player has picked ".. plat2 .. " (locked)")
end
end)
end
i want that the script check it every time if the player picks a agent (its a localscript)
TestC and TestC2 are the characters , they are in replicated storage and then when i press the character they are in workspace
the LOCK IN button, the button should check if one agent has “selected” (click on the button where you can select a agent) and then if you press the LOCK IN button you have picked the agent and no other from your team can pick him.
You could put the player inside a table with a remote event or function. From there you could make a code to have only 1 player in the table which is of course the selected agent.