So, here is my script for spawning a Dummies. I want to limit a number of Dummies to one for each player, how would I do that?
This script is placed in the ServerScriptService:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local spawnEvent = ReplicatedStorage:WaitForChild("SpawnEvent")
local dummy = ReplicatedStorage:WaitForChild("Dummy")
function SpawnDummy(player)
local dummyClone = dummy:Clone()
dummyClone.Parent = game.Workspace
dummyClone.Name = player.Name.."'s "..dummy.Name
dummyClone.Owner.Value = player.Name
end
spawnEvent.OnServerEvent:Connect(SpawnDummy)
Thanks!