generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Different issue!

Previous Thread :: Next Thread 
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:24 PM
I tried scripting myself a Custom Map Loader. But, it runs before it's supposed to! Please help, No idea what went wrong and how to fix! Also, when it says "Selecting map" or a little after, it makes me leave studio. (lag attack)



on = false
function GameTime()
if game.Players.NumPlayers >= 1 then
on = true
m = Instance.new("Hint",game.Workspace)
m.Text = "Waiting for next game."
wait(15)
m.Text = "Selecting a map..."
wait(15)
map = math.random(1,4) --Map settings
if map == 1 then
MapClone = game.Lighting["map"]:Clone()
MapClone.Parent = game.Workspace
elseif map == 2 then
MapClone2 = game.Lighting["map"]:Clone()
MapClone2.Parent = game.Workspace
elseif map == 3 then
MapClone3 = game.Lighting["map"]:Clone()
MapClone3.Parent = game.Workspace
elseif map == 4 then
MapClone4 = game.Lighting["map"]:Clone()
MapClone4.Parent = game.Workspace
wait(1.5)
m.Text = "A map has been selected!"
wait(2)
m.Text = "BEGIN!"
Players = game.Players:GetChildren()
for i,v in pairs(game.Players:GetChildren()) do
game.ServerStorage.Armor:Clone().Parent = v.PlayerGui
game.ServerStorage.Classes:Clone().Parent = v.PlayerGui
game.ServerStorage.Locations:Clone().Parent = v.PlayerGui
wait(1)
m.Text = "Eliminate your opponents!"
wait(160)
m.Text = "Round over!"
wait(2)
Players2 = game.Players:GetChildren()
for i = 1,#Players2 do
Players2[i]:LoadCharacter() --Respawns them
wait(3)
m.Text = "Checking for required players.."
wait(3)
on = false
end
end
end
end
end

while true do
if on == false then
GameTime()
wait(3)
end
end
Report Abuse
Preponderance is not online. Preponderance
Joined: 30 Sep 2009
Total Posts: 21293
06 Feb 2014 08:25 PM
MapClone = game.Lighting[map]:Clone()

No quotes for map
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
06 Feb 2014 08:26 PM
^No...
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:26 PM
Actually, yes. There are quotes for that. It wouldn't make a difference anyhow. I said it happens before the function calls for it..
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
06 Feb 2014 08:28 PM
Why are you using lighting to store the maps? Use server storage. Also instead of doing "while true do" just make on a boolvalue in workspace and when the value is changed it will check if it was changed to true and then call the function.
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:29 PM
Come on guys! I worked hard on making this. I tried making it local. But again, it works it's magic before the function calls for it! Please help!!
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:30 PM
Xtreme, it seems fine the way it is. Does any of this have to do with the issue?
Report Abuse
Preponderance is not online. Preponderance
Joined: 30 Sep 2009
Total Posts: 21293
06 Feb 2014 08:30 PM
lol im trippin


#homeworkamusesme
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:31 PM
Oh crab apples! I had another map script making the maps! darn it!
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
06 Feb 2014 08:31 PM
Try adding an end after these chunks of code:

if map == 1 then
MapClone = game.Lighting["map"]:Clone()
MapClone.Parent = game.Workspace
elseif map == 2 then
MapClone2 = game.Lighting["map"]:Clone()
MapClone2.Parent = game.Workspace
elseif map == 3 then
MapClone3 = game.Lighting["map"]:Clone()
MapClone3.Parent = game.Workspace
elseif map == 4 then
MapClone4 = game.Lighting["map"]:Clone()
MapClone4.Parent = game.Workspace
end --I put this here

--because if you don't add the end after the cloning of map 4, it's going to run the code ONLY if the map # is equal to 4.

for i,v in pairs(game.Players:GetChildren()) do
game.ServerStorage.Armor:Clone().Parent = v.PlayerGui
game.ServerStorage.Classes:Clone().Parent = v.PlayerGui
game.ServerStorage.Locations:Clone().Parent = v.PlayerGui
end -- I put this here

--After that, it will run the round for every single player in the game, (not fun.)

for i = 1,#Players2 do
Players2[i]:LoadCharacter() --Respawns them
end --I put this here
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
06 Feb 2014 08:32 PM
Lol, 8 people already replied after my analysis...
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:33 PM
Okay, there is a different, unknown problem. In studio, my code works. But, when it says "Selecting map" it crashes (studio test) meaning, I have to get out of the game. Every froze. Strangest day ever!
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
06 Feb 2014 08:36 PM
You confuzzled me, studio crashes or the script crashes?

anyway, let me repeat myself.

if you don't add the end after the cloning of map 4, it's going to run the code ONLY if the map # is equal to 4.
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:36 PM
IT WAS JUST A STUDIO THING :D!!
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 08:37 PM
Teh, Sorry if I was ignoring you. I was a bit in a panic and was rushing. Thanks for your help, and k.
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
06 Feb 2014 08:42 PM
No problem c:
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image