Hi, I'm trying to make a game like (The intruder) But I need to make a monster that teleports to random locations chosen by me. I don't know how to do it and there are no tutorials on YouTube. All I need is a script that I put into the NPC and right after the game starts it will be teleported to random locations for a limited time. (For example: NPC will be teleported to part1 then to part4 and then to part 9) Because i have cameras like in FNAF... :D
Thank you for help.
Rohlik1234567890
Next time put your attempts here first, but here you go anways put invisible parts around the workspace and name them part1 part2 etc...
script in serverscriptservice --its not in the npc hope you dont mind
local npc = game.Workspace.NPC --replace this with your npc local part1 = game.Workspace.Part1 local part2 = game.Workspace.Part2 local part3 = game.Workspace.Part3 --make variables for the rest of the parts local PartToTeleport while true do wait(4) --will make it wait 4 seconds before teleporting again, change as you wish PartToTeleport = math.random(1,3) --replace 3 with the amount of parts if PartToTeleport == 1 then npc.HumanoidRootPart.CFrame = part1.CFrame elseif PartToTeleport == 2 then npc.HumanoidRootPart.CFrame = part2.CFrame elseif PartToTeleport == 3 then npc.HumanoidRootPart.CFrame = part3.CFrame --continue like this down for all parts end end
and that should do it hope this helped