-
Make a clone every one click.
-
It clones multiple times when you open it a few times, you click it once and it won’t tween down so then you press it again, it tweens but makes two clones.
-
Tried adding a cooldown.
plr.CharacterAdded:Connect(function(char)
local newvalue = Instance.new("StringValue")
newvalue.Parent = char
end)
game.ReplicatedStorage.Callsign.OnServerEvent:Connect(function(player,text)
print(text)
player.Character.Value.Value = text
for i,v in pairs(game.Players:GetChildren()) do
if v:IsA("Player") then
if v.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then print("callsignevent") end
local clone = v.PlayerGui.Radio.Units.ScrollingFrame.Template:Clone()
clone.Parent = v.PlayerGui.Radio.Units.ScrollingFrame
clone.Visible = true
clone.TextLabel.Text = player.Character.Value.Value..":"..player.Name
local team = player.Team.Name
local image = v.PlayerGui.Radio.Units.ScrollingFrame
clone.Name = player.Name
local modulescript = require(game.ReplicatedStorage.RadioConfig)
if player.Team.Name == modulescript.policeteamname then
clone.ImageLabel.Image = modulescript.Police
end
if player.Team.Name == modulescript.fireteamname then
clone.ImageLabel.Image = modulescript.Fire
end
wait(10)
local Players = game:GetService("Players")
Players.PlayerRemoving:Connect(function(player)
for i,v in pairs(game.Players:GetChildren()) do
if game.StarterGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then
if v:IsA("Player") then
v.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name):Destroy()
end
end
end
end)
end
end
end
)
end)