Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 31 May 2013 04:46 PM |
So I've got this as the detonation function for a grenade, and I'm trying to create a sort of sphere-shaped 'field' around the explosion area, as detailed below. However, nothing shows up in the workspace, and the part doesn't show up at all, but there's no output and the function plays out normally.
function Detonate() main.Boom:Play() main.Transparency = 1 local radianBoom = Instance.new("Part", Workspace) radianBoom.Name = "Explosion" radianBoom.BrickColor = main.BrickColor radianBoom.FormFactor = "Custom" radianBoom.Size = Vector3.new(10, 10, 10) radianBoom.Shape = "Ball" radianBoom.Transparency = 0.4 radianBoom.Anchored = true radianBoom.CFrame = main.CFrame for i,v in pairs(game.Players:GetChildren()) do if (main.Position - v.Character.Torso.Position).magnitude < 10 then v.Character:BreakJoints() end end for i = 1, 10 do radianBoom.Transparency = radianBoom.Transparency + (0.6/10) end main:Destroy() radianBoom:Destroy() end |
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
| |
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 31 May 2013 05:24 PM |
BUMP.
C'mon, if it's something easy, just spit it out. I'm a big boy. I can handle it. |
|
|
| Report Abuse |
|
|
|
| 31 May 2013 09:46 PM |
| Sorry it took me this long to get here! The problem is during the script that sets the radianBoom transparency, there is no wait() line, so it will run the for loop 10 times, one right after another with no delay in between. And since code executes almost immediately, it'd be completely transparent before you even saw it appear. |
|
|
| Report Abuse |
|
|