Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to spawn a boss after touching a part?

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

✓ Accepted answer

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 comment

1

Thanks so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.