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

How do I make all models in my roblox game world regenerate when the round restarts?

Asked by 8 years ago

I have seen many model regeneration scripts that go by time but this is not what I want. I want a script that regenerates the models when my lobby script restarts (the lobby script I am using detects when all players have died and then teleports them out of the lobby and into the game play area).

Lobby script:

01local oldMessage = ""
02local minPlayers = 2
03 
04function teleportAllPlayers()
05    local target = CFrame.new(workspace.TeleportTarget.Position)
06    for i, player in ipairs(game.Players:GetChildren()) do
07        player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
08        player.Playing.Value = 1
09 
10    end
11end
12 
13function message(message)
14    if oldMessage ~= message then
15        oldMessage = message
View all 51 lines...

Sorry if I goofed up while asking this question, this is my first time using this website.

0
This looks like a free model :) User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by
Notwal 2
8 years ago

Group all of the target models and call it "Models" Copy and paste this group into ServerStorage

1function reset()
2    workspace.Models:Destroy()
3    game.ServerStorage.Models:Clone().Parent = workspace
4end
5 
6(if statement regarding whether or not all players have died) then
7    reset()
8end
0
Following you so far but where exactly do I put the script? Sorry, I am really new to this, and thanks so much for the response. SambaLover 16 — 8y
0
Put the reset function with the other functions in your lobby script and put reset() after the teleporting message. Notwal 2 — 8y
0
NARWALS NARWALS User#11440 120 — 8y
0
SWIMMING IN THE OCEAN Notwal 2 — 8y
0
I tried that but it didn't work... could you just give me the whole lobby script with your code in it? Again, I am a complete novice to this. Thanks! SambaLover 16 — 8y
Ad

Answer this question