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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|