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

Hello, i am trying to make like a killer game but its a killer randomizer. How do i make it?

Asked by 2 years ago

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

0
So you mean a survival game? VitroxVox 884 — 2y
0
what exactly do you mean boomthefist 6 — 2y
0
ScriptingHelpers.org is not a request site. You should only post questions with problems you have in your scripts. PaleNoobs 37 — 2y

1 answer

Log in to vote
0
Answered by
Dexiber 272 Moderation Voter
2 years ago

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!

Ad

Answer this question