So I am making a script that spawns a dummy into the workspace, and for some reason instead of spawning one it spawns two. I am on here to see if anybody knows any possible fixes/if I did something wrong. I looked around and can’t seem to find anything related to this, so I hope someone will help.
Screenshot:
local script:
local Humans = game.ReplicatedStorage:WaitForChild("Humans")
local tb = script.Parent.CarButton
tb.MouseButton1Click:Connect(function()
for i, hum in pairs(Humans:GetChildren()) do
game.ReplicatedStorage.humev.ChadSpawnRe:FireServer(hum)
print("Yes!")
end
end)
Server Script:
local Hums = {}
game.ReplicatedStorage.humev.ChadSpawnRe.OnServerEvent:Connect(function(plr, hum)
local newHum = game.ReplicatedStorage.Humans.ChadTheCreator:Clone()
local hrp = plr.Character.HumanoidRootPart
newHum:SetPrimaryPartCFrame(hrp.CFrame + (hrp.CFrame.LookVector * 10) + Vector3.new(0, 10, 0))
newHum.Parent = workspace
Hums[plr] = newHum
end)