and im not talking like murder mystery im talking about bot killers that you have to survive for 90 seconds then a new killer spawns and the old one gets deleted
please help me find some tutorial
Here's a way:
-Also, please do not request on this site, the purpose is to help fix what you already have.
Step 1: Create a folder of the killers, and put all of them in that folder, and name it "Killers", parent it into ReplicatedStorage.
Step 2: Make sure you have a spawn point of where you want the killer to spawn, make sure it is named "KillerSpawnPoint".
Step 3: Add a script in ServerScriptService, name it whatever you like.
Step 4: Write this code in the script, I will add notes to help you understand it:
local killers = game.ReplicatedStorage.Killers --Getting the folder of killers we made in ReplicatedStorage local spawnPoint = game.Workspace.KillerSpawnPoint local currentKiller = nil -- Show the current killer so we can delete it when starting a new round. local function AddKiller() -- Add the killer local chosenKiller = killers:GetChildren()[math.random(1,#killers:GetChildren())] -- Getting the random killer local clone = chosenKiller:Clone() -- Clone it so we dont mess up the game. clone.Parent = game.Workspace -- If we dont parent it into the workspace, it won't appear. clone:MoveTo(spawnPoints.Position) -- Make sure the killer is moved to it's spawn point. currentKiller = clone-- set the current killer to the one we cloned. end local function RemoveKiller() -- Remove the killer (Useful for when starting a new round). if currentkiller then -- Making sure the killer was set currentKiller:Destroy() -- Remove the killer so you dont have two at the same time currentKiller = nil -- Set the killer to nothing so the script doesnt get confused. end end while wait() do -- Make a loop for rounds (just an example). AddKiller() wait(90) -- Set the number for the duration of rounds (seconds), you wanted 90. RemoveKiller() wait(15) -- Intermission between rounds. end
This should help you get an understanding of how it works. If anything is wrong with it, let me know!