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: Bomb Script [Should work?]

Previous Thread :: Next Thread 
Driwi is not online. Driwi
Joined: 30 Sep 2014
Total Posts: 2
03 Oct 2014 04:32 PM
I have this little bomb script as shown:


local Bomb = script.Parent
local Mesh = Bomb.Mesh
if Bomb.Parent == game.Workspace then
Bomb.Touched:connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
if Mesh.Scale == Vector3.new(4, 4, 4) then
wait(2)
local BombExplosion = Instance.new("Explosion", game.Workspace)
BombExplosion.Position = Bomb.Position
Bomb:Destroy()
end
end
end)
end


Which is supported by this script, the one that increases the bomb's mesh size:

local Bomb = script.Parent
local Mesh = Bomb.Mesh
Bomb.Touched:connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
while wait(0.2) do
Mesh.Scale = Mesh.Scale + Vector3.new(0.1, 0.1, 0.1)
end
end
end)

What is the problem? The bomb continuously increases its mesh size without stopping. I have not recieved any output to post.
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
03 Oct 2014 04:55 PM
"while wait(0.2) do"

use a for loop instead

or a repeat loop

or anything that isnt infinite
Report Abuse
Driwi is not online. Driwi
Joined: 30 Sep 2014
Total Posts: 2
03 Oct 2014 05:43 PM
That only maade it so that the bomb only grows when a player touches it. I don't want that.

It still doesn't work, anyhow.
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
03 Oct 2014 05:48 PM
local Bomb = script.Parent
local Mesh = Bomb.Mesh
Bomb.Touched:connect(function(Hit)
if Bomb.Parent == game.Workspace then
if Hit.Parent:FindFirstChild("Humanoid") then
if Mesh.Scale == Vector3.new(4, 4, 4) then
wait(2)
local BombExplosion = Instance.new("Explosion", game.Workspace)
BombExplosion.Position = Bomb.Position
wait(1)
Bomb:Destroy()
end
end
end)
end
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
03 Oct 2014 05:55 PM
this works

local Bomb = script.Parent
local Mesh = Bomb.Mesh

Bomb.Touched:connect(function(Hit)
if Bomb.Parent == game.Workspace then
if Hit.Parent:FindFirstChild("Humanoid") then
if Mesh.Scale == Vector3.new(4, 4, 4) then

wait(2)
local BombExplosion = Instance.new("Explosion", game.Workspace)
BombExplosion.Position = Bomb.Position
Bomb:Destroy()
end
end
end
end)








.----------------------------------------------------------------------
local Bomb = script.Parent
local Mesh = Bomb.Mesh
Bomb.Touched:connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
while wait(0.2) do
Mesh.Scale = Mesh.Scale + Vector3.new(0.1, 0.1, 0.1)
end
end
end)
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