You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
- Script that spawns multiple zombies when you chat for example,
“/spawn ZombieName 50”
- What is the issue? Include screenshots / videos if possible!
- No videos/screenshots but it just doesn’t work, no errors.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
- I looked alot but none helped me.
Here is the code i tried.
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(chat)
for i, v in pairs(game.Players:GetPlayers()) do
if v.Name == "JmPopYT" or v.Name == "14xqvxzy" then
local chatSplit = chat:split()
if chatSplit[1] == "/spawn Zombie" then
for i = 1, chatSplit[2] do
local zombie = game.ReplicatedStorage.Zombies.Zombie:Clone()
zombie.Parent = workspace
zombie:PivotTo(plr.Character:WaitForChild("HumanoidRootPart").CFrame)
end
end
end
end
end)
end)
Thanks, ~Pop