User:Buckethead101: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Buckethead101
No edit summary
>JulienDethurens
Nominated for deletion.
 
(16 intermediate revisions by one other user not shown)
Line 1: Line 1:
= How to Make Precipitation =
{{delete}}
 
So you have storm clouds over you place. Just storm clouds. No rain. Not yet, anyway. If you don't have storm clouds, but you want them, search "cloud" or "storm clouds" in free models.
 
 
== Building The Droplet ==
 
So first, we need to build the droplet. On the toolbar click Insert, go down and find objects, and click it. A window will come up. Find "Part" on that window, and double-click it. There will now be a brick in your place. Now you need to make the brick look like a rain droplet. I suggest you follow these guidlines:
 
*In the properties of the brick that you want to be a droplet, set the size to 1,1,1
*Set the shape to ball
*Set the color to any shade of blue
*Set the Transparency to something between 0.1 and 0.4
*Set the reflectance to 0.1
*Make sure you uncheck the CanCollide box, unless you want the droplets to stay on the ground.
 
So now you have your droplet. Name it "Drop" (without quotes), drag it to a spot on the map where people might not find it, and anchor it.
 
== The Script ==
 
Now comes the important part- the script.
 
First, we want it to loop.
<pre>while true do -- a continuous loop </pre>
Now we need to put how long it will wait before making another.
<pre>wait(0.1) -- one tenth of a second </pre>
Next comes the actual rain.
<pre>game.Workspace.Drop:clone() -- makes a copy of the droplet </pre>
Here's our script so far:
<pre>while true do -- a continuous loop
wait(0.1) -- one tenth of a second
droplet = game.Workspace.Drop:clone() -- makes a clone of the droplet and tags it as "droplet" </pre>
So far, so good. But wait; we have to define droplet's parent and position, and unanchor it.
<pre>droplet.Parent = game.Workspace -- makes droplet appear in the game
droplet.Anchored = false -- unancors the droplet
droplet.Position = Vector3.new(math.random(-512,512),100,math.random(-512,512)) -- creates droplet </pre>
Now lets see what we have.
<pre>while true do -- a continuous loop
wait(0.1) -- one tenth of a second
droplet = game.Lighting.Drop:clone() -- makes a clone of the droplet and tags it as "droplet"
droplet.Parent = game.Workspace -- makes droplet appear in the game
droplet.Anchored = false -- unancors the droplet
droplet.Position = Vector3.new(math.random(-512,512),100,math.random(-512,512)) -- creates droplet </pre>
Now all we have to do is end the script.
<pre> end </pre>
 
=== The Finished script ===
<pre>while true do -- a continuous loop
wait(0.1) -- one tenth of a second
droplet = game.Workspace.Drop:clone() -- makes a clone of the droplet and tags it as "droplet"
droplet.Parent = game.Workspace -- makes droplet appear in the game
droplet.Anchored = false -- unancors the droplet
droplet.Position = Vector3.new(math.random(-512,512),100,math.random(-512,512)) -- creates droplet
end </pre>
 
Just put that code into a script in workspace, and voilà- you should have rain falling from the sky when you go to your place! Feel free to edit the script as you please.
 
== A Little Extra Fun ==
 
If you're looking for some fun, put the code below into a script inside the Drop brick.
 
<pre>function onTouch(hit)
local p = Instance.new("Explosion")
p.Parent = game.Workspace
p.Position = script.Parent.Position
p.BlastRadius = 5
p.BlastPressure = 1000
script.Parent:remove()
wait(0.5)
p:remove()
end
 
script.Parent.Touched:connect(onTouch) </pre>
 
That will make bombs fall from the sky! Looks like you're going to need an umbrella.

Latest revision as of 22:54, 5 May 2012

This page has been nominated for deletion