Answers for "roblox dev how to spawn npc with location"

Lua
0

roblox dev how to spawn npc with location

local JFKspaWn = game.ReplicatedStorage.Cloneables.JFK.HumanoidRootPart

local JFK = game.ReplicatedStorage.Cloneables.JFK

local SSAgentspaWn = game.ReplicatedStorage.Cloneables.SSAgent.HumanoidRootPart

local SSAgent = game.ReplicatedStorage.Cloneables.SSAgent

function SpawnNPCs()

local newJFK = JFK:Clone()

newJFK.Parent = workspace

newJFK:MoveTo(Vector3.new(-172.606, 0.673, 6.5))

local newSSAgent = SSAgent:Clone()

newSSAgent.Parent = workspace.WalkingSSAgentsSpawnable

newSSAgent:MoveTo(Vector3.new(-174.52, 2.433, 14.632))

end

function beginNPCs()

SpawnNPCs()

game.Workspace.BindableEvents.SSAgentWalkToward:Fire()

end

beginNPCs()

game.Workspace:WaitForChild("SpawnJFK").Event:Connect(function()

beginNPCs()

end)
Posted by: Guest on May-06-2020

Browse Popular Code Answers by Language