I’m trying to do an “Detect System” when a player clicks a UI button it copies an billboard gui with frame in it from workspace in to other players and only the player that clicked the UI button will see the billboard gui in other players. It does work but the billboard gui gets copied in to 1 player and not all the players as it should.
The script:
local players = game.Workspace.GameSystem.PlayersInGame.Survivor
local Button = script.Parent
local Used = false
Button.MouseButton1Click:Connect(function()
if Used == false then
for i, plrs in ipairs(players:GetChildren()) do
if plrs.Name ~= game.Players.LocalPlayer.Name then
Used = true
local particles2 = Instance.new("BillboardGui")
particles2.Size = UDim2.new(6,0,6,0)
particles2.AlwaysOnTop = true
local particles = workspace.BillboardGui.ImageLabel:Clone()
particles.Parent = particles2
particles2.Parent = plrs.UpperTorso
wait(10)
particles2:Destroy()
wait(120)
Used = false
end
end
end
end)
I guess it should be created when Used is false and, while this happens, it should turn true and when it finishes being false again, wait(120) and wait(10) delay the loop.
local players = workspace.GameSystem.PlayersInGame.Survivor
local Button = script.Parent
local Used = false
Button.MouseButton1Click:Connect(function()
if Used == false then
Used = true
for i, plrs in ipairs(players:GetChildren()) do
if plrs == game:GetService("Players").LocalPlayer then
continue
end
local particles2 = Instance.new("BillboardGui")
particles2.Size = UDim2.new(6,0,6,0)
particles2.AlwaysOnTop = true
particles2.Parent = plrs.UpperTorso
local particles = workspace.BillboardGui.ImageLabel:Clone()
particles.Parent = particles2
game:GetService("Debris"):AddItem(particles2, particles2)
end
task.wait(130)
Used = false
end
end)
Thank you so much, It worked but after 10 seconds all billboard guis should destroy, how do i do that? I tried customizing the script but then it didnt work.