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

[SOLVED] How do I prevent this from not loading a map?

Asked by 4 years ago
Edited 4 years ago

The map load works in studio, but in game... When a map change it changes, but when it change again it stops working and just sends out nothing at all. (This is a script for a friend I'm currently making... Belongs in ServerScriptService)

01local maps = game.Lighting.Maps:GetChildren() --Where the map belongs and how the script grabs it
02local msg = Instance.new("Message")
03local Death = game.Workspace.Baseplate
04 
05while true do -- a loop
06    Death.CanCollide = true -- just incase line 19 fails
07    msg.Parent  = game.Workspace
08    msg.Text = ("Loading New Map (Same map will occur, I can't prevent that since this randomizes.)")
09    wait(7)
10    chosenmap = maps[math.random(1,#maps)] -- gets a random map
11    chosenmap:Clone().Parent = workspace -- sets the parent to workspace
12    msg:remove()
13    Death.CanCollide = false
14    for i,v in pairs(game.Players:GetChildren())do
15        if v.Character then
View all 24 lines...
0
try putting a wait(1) right after the while true loop Lamborghinihurican0 4 — 4y
0
Don't think that'll do anything TheBuliderMC 84 — 4y
0
you need to put wait() for while true do to work. Just put wait() without any number and it will work. Shounak123 461 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

I think you forgot to publish your place. Click File on the upper left corner, then click Publish To Roblox. In this way, you can make it as it is in the studio.

0
I did publish, The script works for like 2 times and then stops and sends nothing to change the map.. TheBuliderMC 84 — 4y
0
you need to put wait() for while true do to work. Just put wait() without any number and it will work. Shounak123 461 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Answer by: Shounak123

" you need to put wait() for while true do to work. Just put wait() without any number and it will work"

Answer this question