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

How to make a scripted weather GUI effect?

Asked by
RedCombee 585 Moderation Voter
9 years ago

I'm trying to see if I can make it look like it's raining, snowing, etc. in my game with GUIs. I personally don't know where to start, but if you could lead me to a tutorial or give me some insight, I would truly appreciate it.

1 answer

Log in to vote
0
Answered by 9 years ago

Hello. I will try to help you, and this will be in-depth.


What you first would like to do is create, say, four images that would make a GIF image of rain. Be sure the images have transparent backgrounds so the player can see ahead. Also, the rain drops, snow flakes, etc. do not have to be "cartoony" and definately keep them a smaller size. A good effect you could do is make the original drops fall each image and new ones appear (so not just random dots popping up on the screen). It is best to do this on Paint.NET or another image creation program.

Next you will want to set up the GUI. In order to be sure you are creating the GUI correctly, you will want to insert a ScreenGui inside of the StarterGui. Inside of the ScreenGui you just inserted, insert an ImageLabel. Inside of the ImageLabel properties, change the size to {1, 0},{1, 0}.

Instead of creating a thousand ImageLabels for each image, we will change the Image directly in the script. Now, directly inside of the ImageLabel, insert a Script. The script should automatically pop up with print("Hello World!"). Delete that line and start with while wait(0) do and press the Enter key. end should automatically be placed on the third line. So far the script should look as follows:

while wait(0) do

end

Under while wait(0) do put in script.Parent.Image = "rbxassetid://" and after rbxassetid:// put your decal ID, minus one number, inside of the quote. Press Enter again. Put wait(0) and press Enter again. Then insert the same line as before and change the numbers from the first one to the numbers of your second decal ID, minus one. Then wait(0), otherwise it will try to change to all of the images at once and most likely crash.

NOTE: If you are having troubles with the IDs, you can insert a decal and copy the end numbers off of the assetid. They are the same IDs.

Continue doing the script.Parent... and wait(0) until you have all of your uploaded decals. On your last image, you do not have to put wait(0) after it because it will wait 0 automatically because you told it to with while wait(0) do.

Now, you can go back to the original window which shows the physical game (parts, etc.) and press F6. Studio will then open another window, select it. Once it loads, you should see raindrops (or whatever weather you put in). If this is too fast, you can always change all wait(0)s to wait(0.1) or something different.

Your final script should look as follows:

while wait(0) do
    script.Parent.Image = "rbxassetid://"
    wait(0)
    script.Parent.Image = "rbxassetid://"
    wait(0)
    script.Parent.Image = "rbxassetid://"
end

If you have any further questions please ask. I hope this was a help!

Ad

Answer this question