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

How to spawn a boss after touching a part?

Asked by 2 years ago

So, I wanted to make a FPS Zombie shooter game. I was going to make a part that if you touched, Spawns a boss. I'm VERY new to Roblox coding but either nothing happens, or its spawns multiple. Here is the script I most recently tried out: local part = script.Parent

part.Touched:Connect(game.ReplicatedStorage.MechaSpider)

1 answer

Log in to vote
0
Answered by 2 years ago

This is not as complicated as you may think it is. What you want to do is simply just add a few lines of code to this. Be sure to put the mecha spider into ReplicatedStorage.

script.Parent.Touched:connect(function(otherPart) -- Detects when the part is touched
if otherPart.Parent:FindFirstChild("Humanoid") ~= nil then -- Detects of the thing that touched the object is a humanoid

game.ReplicatedStorage.MechaSpider.Parent = workspace -- Puts the boss into workspace

end
end)
1
Thanks so much! Ziper123light 3 — 2y
Ad

Answer this question