badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 31 May 2014 04:09 PM |
Is there a way to speed up my particle as it falls?
here's a solution someone gave me to fix my script. Now the only thing is that the gravity is linear.
grav_force = 5 terminal_velocity = 10
function update() for _,v in pairs(script.Parent:GetChildren()) do if v.Name == "Particle" then -- Something like that v.Position = v.Position + UDim2.new(0, 0, 0, grav_force + 1)
end end end
Is there a way I can make it gain speed as it falls until it reaches terminal velocity?
'I am the greatest script in the realm. You can only hope to be as powerful of a script as I am, processing the world, bit by bit.' - Oysi 2014 |
|
|
| Report Abuse |
|
|
|
| 31 May 2014 04:12 PM |
| Is the particle moving by positioning or gravity doing it's work? |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 31 May 2014 04:13 PM |
This is the full script, boshi
--Particle-- wait(1) grav_force = 5 terminal_velocity = 10 function coroy() while wait(1) do grav_hori = math.random(-6, 3) end end
local coro = coroutine.create(coroy) coroutine.resume(coro)
local mouse = game.Players.LocalPlayer:GetMouse() local button = script.Parent.TextButton local l = Instance.new("Frame") l.Size = UDim2.new(0.001, 3,0.001,3) l.Name = "Particle" l.BackgroundColor3 = Color3.new(242, 213, 77/255) down = false m = l:clone() button.MouseButton1Down:connect(function() m:clone().Parent = script.Parent m.Position = UDim2.new(0, mouse.X, 0, mouse.Y) end)
function update() for _,v in pairs(script.Parent:GetChildren()) do if v.Name == "Particle" then -- Something like that v.Position = v.Position + UDim2.new(0, 0, 0, grav_force + 1)
end end end
while wait(0.05) do update() end
'I am the greatest script in the realm. You can only hope to be as powerful of a script as I am, processing the world, bit by bit.' - Oysi 2014 |
|
|
| Report Abuse |
|
|
|
| 31 May 2014 04:18 PM |
OH it's a Gui.
Try adding in these lines in the function:
if grav_force < 10 then grav_force = grav_force + 1 end
|
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 31 May 2014 04:19 PM |
How exactly would I use this? Because if I add it inside the in pairs loop, it'll just move fast.
'I am the greatest script in the realm. You can only hope to be as powerful of a script as I am, processing the world, bit by bit.' - Oysi 2014 |
|
|
| Report Abuse |
|
|
solman123
|
  |
| Joined: 10 Oct 2008 |
| Total Posts: 7282 |
|
|
| 31 May 2014 04:20 PM |
What bosh said SHOULD work I don't know very much lua, and I believe Boshi does. (by "don't know very much", I mean I can kill a player in the workspace, and that's it.)
Pick. Plot. Play. ~~~ Hail King Salmon123, lord of salmon! ~~~ |
|
|
| Report Abuse |
|
|
|
| 31 May 2014 04:21 PM |
| Put the lines somewhere in the update function, and it'll only move as fast as whatever your terminal velocity is. |
|
|
| Report Abuse |
|
|
|
| 31 May 2014 04:22 PM |
| have you tried turning it off and the back on again |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 31 May 2014 04:22 PM |
So like this?
function update() for _,v in pairs(script.Parent:GetChildren()) do if v.Name == "Particle" then -- Something like that v.Position = v.Position + UDim2.new(0, grav_hori, 0, grav_force)
end end end
while wait(0.05) do update() if grav_force < 10 then grav_force = grav_force + 1 end end
'I am the greatest script in the realm. You can only hope to be as powerful of a script as I am, processing the world, bit by bit.' - Oysi 2014 |
|
|
| Report Abuse |
|
|
|
| 31 May 2014 04:23 PM |
| Yeah, you could also put it under the line where it positions the particle but it works either way. |
|
|
| Report Abuse |
|
|
badfitz99
|
  |
| Joined: 01 May 2010 |
| Total Posts: 5854 |
|
|
| 31 May 2014 04:28 PM |
Another quick question, how can I make it so if I hold down click, it'll keep creating particles
'I am the greatest script in the realm. You can only hope to be as powerful of a script as I am, processing the world, bit by bit.' - Oysi 2014 |
|
|
| Report Abuse |
|
|
|
| 31 May 2014 04:29 PM |
it is inactive not unactive you dumby!!!
~ I'm still a ghost noob |
|
|
| Report Abuse |
|
|