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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re:

Previous Thread :: Next Thread 
PaperOstrich is not online. PaperOstrich
Joined: 23 Mar 2013
Total Posts: 1591
15 Sep 2013 04:26 PM
Wasn't working at first, but then I realized that "finish" was capitalized so I fixed that, then I tested it and the game just started to crash after about 3 seconds after the message popped up the game would just crash.
I tested this in play mode too and I honestly have no idea what's wrong, please help me out, here is the script:

local maps = {
game.Lighting.Waterways
}

function chooseAndLoadMap()
local chosen = maps[math.random(1,#maps)]
local map = chosen:clone()
map.Parent = workspace
return map
end

local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = ("Race your opponents to the end of the map!")
wait(3)
msg:remove()
local player = game.Players:GetPlayers()
for i = 1, #player do
player[i].Character:MoveTo(Vector3.new(348, 18, -130))
end

function getWinner(map)
map.finish.Touched:connect(function(hit)
if hit.Parent.Parent:IsA("Player") then
return hit.Parent.Parent
end
end)
end



while true do
--TODO: Countdown function
--TODO: Wait for enough players function
local map = chooseAndLoadMap()

--TODO: Teleport players function
-- Display messages and stuff
local winner = getWinner(map)
--TODO: Teleport players back and destroy the map functions
end





/watch?v=jofNR_WkoCE
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
15 Sep 2013 04:27 PM
Do you have a wait() in the while true do?
Report Abuse
PaperOstrich is not online. PaperOstrich
Joined: 23 Mar 2013
Total Posts: 1591
15 Sep 2013 04:31 PM
I hate wait()'s and a while true do, but they aren't connected



/watch?v=jofNR_WkoCE
Report Abuse
PaperOstrich is not online. PaperOstrich
Joined: 23 Mar 2013
Total Posts: 1591
15 Sep 2013 04:38 PM
bumpppp



/watch?v=jofNR_WkoCE
Report Abuse
Reyne is not online. Reyne
Joined: 23 Jan 2008
Total Posts: 586
15 Sep 2013 04:39 PM
while wait() do works better.
Report Abuse
PaperOstrich is not online. PaperOstrich
Joined: 23 Mar 2013
Total Posts: 1591
15 Sep 2013 04:54 PM
That helped remove the crash
but now when you get teleported it's extremely laggy



/watch?v=jofNR_WkoCE
Report Abuse
PaperOstrich is not online. PaperOstrich
Joined: 23 Mar 2013
Total Posts: 1591
15 Sep 2013 05:15 PM
mor halp



/watch?v=jofNR_WkoCE
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