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

My Round script wont work, whats wrong with it? [closed]

Asked by
Soulzs 0
9 years ago

The script works fine, it just makes un-anchored models (With sticking surfaces (Universal, Studs, Inlets and glue) It just generates the map broken! And its for a disaster game so the map needs to be destroyable not destroyed. I've reset the script so you know what the functions and loop systems do. Thanks for your time!

while true do
wait(60) --Waits 1 minute in between games
m = Instance.new("Message") --Creates a new message
local players = game.Players:GetChildren() -- String array where we store all the players
local num = math.random(1,1) --Here, put (1,[total number of maps]
if num == 1 then --Copy and paste this next section for each map, changing the number from 1 to 2, 3, and so on.
m.Parent = game.Workspace --Puts our message in Workspace
m.Text = "Choosing Minigame..." --Feel free to change these next couple of lines as needed
wait(4)
m.Text = "Game Number " ..num.. " Was Chosen"
wait(3)
m.Text = "[MAP NAME]; Maker: [MAP MAKER NAME]"
wait(3)
m.Text = "[INSTRUCTIONS]"
wait(3)
m.Text = "This game lasts for [TIME]."
wait(3)
m.Parent = nil
game.Lighting.Minigame1:clone().Parent = game.Workspace --Change the "Minigame1 to the name of your map (stored in Lighting) 
for i = 1, # players do
players[i].Character:MoveTo(Vector3.new(­-53.723, 346.569, 91.323)) --Change these coordinates to where you want the players to spawn
game.Lighting.LinkedSword:clone().Parent = players[i].Backpack --Change LinkedSword to the name of a weapon (in Lighting) you want to give to the players. You can either delete this line or copy paste more of it.
end
wait(120) --This is how long the game will last
game.Workspace.Minigame1:Remove() --Change Minigame1 to the name of your map.
m.Parent = game.Workspace
m.Text = "Game over! Thank you for playing!"
wait(3)
m.Text = "You have 1 minute until the start of the next game."
wait(3)
m.Parent = nil
end
m:Remove()
end

You copy and paste this script to add another map variable.

0
This is a Free Model, I have seen it before... Due to crudy coding this script will not function the way you need it to. MessorAdmin 598 — 9y
1
Are you guys down voting because it is a free model? If so, you should be ashamed, who the hell cares if he uses a free model, he just wants help fixing the script. Muoshuu 580 — 9y
0
This is not a free model, i got it off a YouTube video for how to make a minigame Here is the link! Soulzs 0 — 9y

Locked by BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 9 years ago

I will elaborate Hibobb's answer so that the user can understand more properly.

local tempmap = game.Lighting.Minigame1:Clone() -- We look for the map in Lighting and clone it
local tempmap:MakeJoints() -- We add joints to this map so that it won't go unanchored when it's cloned.
local tempmap.Parent = workspace -- We set the map's parent to Workspace (which is where it will be located)
--and just for good measure
for _,v in pairs(tempmap:GetChildren()) do -- This following loop goes through each part of the map
    if v:IsA("BasePart") then -- If each object is a Part then..
        v.Anchored = true -- We will anchor each part from the map to avoid being destroyed.
    end
end

Hope this helps!

Ad
Log in to vote
-1
Answered by
Hibobb 40
9 years ago
game.Lighting.Minigame1:clone().Parent = game.Workspace

to -->

local tempmap = game.Lighting.Minigame1:Clone()
local tempmap:MakeJoints()
local tempmap.Parent = workspace
--and just for good measure
for _,v in pairs(tempmap:GetChildren()) do
    if v:IsA("BasePart") then
        v.Anchored = true
    end
end
0
Please do not simply post code for that does not help the user to understand the reason behind your answer, and does not help the user learn how it is properly used. TheeDeathCaster 2368 — 9y