Hello my friend is trying to make a system for his game so whenever he clicks a button a new one of that model spawns and he asked me to script it which i thought was easy… then a ran into a problem, the spawning is easy, but when it comes to naming the box it gets out of my range of scripting. Here is my problem whenever you click the button it spawns the model and names it neon, but after the cooldown if you try to spawn it again it does spawn, but it doesn’t appear and is invisible because the script will only recognize the original neon model, so if there was a way i could name the neon boxes for example neon 1 or neon 2 every time a new one is spawned that would be great.
Script
local fff = game.Workspace.BOX:Clone()
script.Parent.ClickDetector.MouseClick:Connect(function(player)
fff.Parent = game.Workspace
fff.Name = "Neon"
game.Workspace.Neon.VehicleSeat.Anchored = false
game.Workspace.Neon.Side1.Anchored = false
game.Workspace.Neon.Side2.Anchored = false
game.Workspace.Neon.Side3.Anchored = false
game.Workspace.Neon.Side4.Anchored = false
game.Workspace.Neon.Bottom.Anchored = false
game.Workspace.Neon.VehicleSeat.Transparency = 0
game.Workspace.Neon.Side1.Transparency = 0
game.Workspace.Neon.Side2.Transparency = 0
game.Workspace.Neon.Side3.Transparency = 0
game.Workspace.Neon.Side4.Transparency = 0
game.Workspace.Neon.Bottom.Transparency = 0
game.Workspace.Neon.VehicleSeat.CanCollide = true
game.Workspace.Neon.Side1.CanCollide = true
game.Workspace.Neon.Side2.CanCollide = true
game.Workspace.Neon.Side3.CanCollide = true
game.Workspace.Neon.Side4.CanCollide = true
game.Workspace.Neon.Bottom.CanCollide = true
script.Disabled = true
wait(10)
script.Disabled = false
end)