generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Need help instancing parts.

Previous Thread :: Next Thread 
Geomaster is not online. 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 is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
31 May 2013 04:54 PM
Bamp.
Report Abuse
Geomaster is not online. 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
wonderful72pike is online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image