Hello, I'm a developer for a Battlebots game, of which can be found here
One of the biggest issues that players have reported is that people can spawn several machines using our spawn buttons, and despawn other people's machines.
My goal is to figure out a way where people can only spawn a single machine, and can only despawn the machine they spawned. We do not use GUIs for the spawns, and our best scenario is to keep it that way.
Here is a script for one of the machine spawners,
Robot = game.ServerStorage:FindFirstChild("Aegis",true)
Spawned = script.Parent:FindFirstChild("Spawned",true)
function onClicked(hit)
if Spawned.Value == false then
backup = Robot:clone()
backup.Parent = workspace
backup:makeJoints()
Spawned.Value = true
script.Parent.BrickColor = BrickColor.new("Really red")
elseif Spawned.Value == true then
backup:Destroy()
Spawned.Value = false
script.Parent.BrickColor = BrickColor.new("Lime green")
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Each machine is a separate model put into server storage, where then it's loaded into the game and that's about it
There is most definitely a way to make this work, and I've tried a few ideas using bool values but have had no success
Where should I start with this concept?

2 comments
Sorry about my concept before, I misread the question
Are there multiple buttons?