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
 

Re: My First Attempt at Scripting...

Previous Thread :: Next Thread 
Birdzy is not online. Birdzy
Joined: 15 Jul 2011
Total Posts: 285
29 May 2012 03:06 PM
math.randomseed(tick())


function doWeather()
wait(math.random(0.01, 0.1))
weather = math.random(1, 2)
print(weather)
if weather == 1 then
StarterGui:FindFirstChild("RainGUI")
if found then
found.Visible = false
end
if weather == 2 then
StarterGui:FindFirstChild("RainGUI")
if found then
found.Visible = True
end

while true do
doWeather()
wait(24)
end

~~~~~~
I tried to make a script so a rain GUI would turn on and off. It doesn't work (not surprisingly). Any help?
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 May 2012 03:12 PM
There is a syntax error. The output bar would tell you that there is one, and roughly where it is. That's very helpful for yourself so you don't need to go to other people, and when it's being useless about it (which it sometimes is) it will help other people find the problem.

This says

input:23: 'end' expected (to close 'if' at line 13) near < eof >

eof means end-of-file. 'end' expected means it expected another 'end' statement before reaching what the error is near (eof).

The while loop is closed correctly, so the problem must be occurring above it.

Looking at your doWeather function,you can see that you have to close the if weather == 2, the if weather == 1, and the function doWeather().
Based on this, I think you need to reevaluate how you're doing this function, because it will not work in any constructive way.

But those are where you need the ends.
Report Abuse
3lex33 is not online. 3lex33
Joined: 08 Oct 2008
Total Posts: 5220
29 May 2012 03:12 PM
found = game.StarterGui:findFirstChild("RainGUI")

Also:

function doWeather()
--code
if weather == 1 then
--code
found = .....
if found then
--code
end

ELSEIF weather == 2 then

found = .....
if found then
--code
end

END -- for weather comparsion
END -- to close function

Lastly, this code will edit startergui, but not players GUI. So you might not see the effect.
Report Abuse
onehundredpwn is not online. onehundredpwn
Joined: 06 Feb 2011
Total Posts: 4985
29 May 2012 03:13 PM
[ Content Deleted ]
Report Abuse
Birdzy is not online. Birdzy
Joined: 15 Jul 2011
Total Posts: 285
29 May 2012 03:20 PM
Yeah, well, I assumed it would go wrong.
I'll probably check out that tutorial, thanks.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
29 May 2012 03:22 PM
You should also be doing something a little easier as your first script...unless that was a cover up for a non-working freemodel.
Report Abuse
Birdzy is not online. Birdzy
Joined: 15 Jul 2011
Total Posts: 285
29 May 2012 03:55 PM
Yeah. It's for a game I'm making, it's supposed to be randomized weather... I can only edit free scripts to a certain degree, let alone make my own.
Report Abuse
Birdzy is not online. Birdzy
Joined: 15 Jul 2011
Total Posts: 285
29 May 2012 05:19 PM
Does anyone think they could help me fix it? Or at least help me make a decent weather script? I just want rain and sun for now.
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