Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can you help me with this script?

Asked by
red106 0
10 years ago

I was trying to make a script that would spawn npc to a random location when it dies. Can someone help me?

1 answer

Log in to vote
0
Answered by 10 years ago
local model=script.Parent:Clone()
script.Parent.Humanoid.Died:connect(function()
wait(5)
m=model:Clone()
m.Parent=script.Parent.Parent
m:MoveTo(math.random(script.Parent:GetModelCFrame().p.X-50,script.Parent:GetModelCFrame().p.X+50)),1,math.random(script.Parent:GetModelCFrame().p.Z-50,script.Parent:GetModelCFrame().p.Z+50))
script.Parent:Destroy()
end)

I haven't tested this, but it should work.

0
Would it go in the npc ? red106 0 — 10y
0
Yes. TheGuyWithAShortName 673 — 10y
Ad

Answer this question