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

Why can I not destroy a map in a game?

Asked by 6 years ago
Edited 6 years ago

So I am making a game and I have a maps that are randomly picked and after the round I am trying to destroy them with :Destroy() but it wont work. Can someone help me with this? Everything else works except this.

Code

001Maps = {"Campout", "Pyramid", "Temple"}
002intermission = 5 -- time until flood comes
003gamewait = 5 -- how long the flood stays
004numofplayers = 1 -- How many players are required to play
005timebeforeround = 5 --Time before flood
006    wait()   
007 
008function m(update)
009    c = game.Players:GetChildren()
010    for i=1, #c do
011           c[i].PlayerGui.InformationGui.Frame.TextLabel.Text = "" .. update
012    end
013end
014 
015 
View all 116 lines...
0
no code = no solution Vulkarin 581 — 6y
0
Can you please use code blocks instead of text? I get that some parts of the code are in code blocks, but the other parts are in text so it makes it unreadable.. brokenVectors 525 — 6y
0
Ok I put it all in a code block. But its the cmap that I cant destroy. protectiverobos -50 — 6y
0
Why are you trying to put the parent of cmap to workspace after destroying it? User#21908 42 — 6y
0
if I helped you out please accept my answer. Otherwise comment how I can help you better. User#21908 42 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

there are two problems I see and I hope I can help here they are:

1-- first rndum on line 34 should be like this
2local rndum = math.random(1, #Maps)
3-- second and this should solve your problem is that when calling destroy you dont put anything in the brackets here is what it should look like:
4cmap:Destroy()
Ad

Answer this question