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 » Scripters
Home Search
 

Re: Reload

Previous Thread :: Next Thread 
Jas1066 is not online. Jas1066
Joined: 11 Jun 2010
Total Posts: 647
17 Apr 2012 11:15 AM
Could some one add a reload thing to this so you can only place the bomb every 10 secounds

Tool = script.Parent
local planting = true
local bomb = nil

local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/asset/?id=28517063"
sound.Looped = true

local explosion = Instance.new("Sound")
explosion.SoundId = "http://www.roblox.com/asset/?id=28518734"
explosion.Volume = 0.01
explosion:Play()
explosion.Volume = 0.5

function plant(pos)

Tool.Handle.Plant:Play()

local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)

local spawnPos = vCharacter.PrimaryPart.Position

bomb = Instance.new("Part")
bomb.Locked = true
bomb.formFactor = 2
bomb.Size = Vector3.new(1,0.4,1)
bomb.Name = "Mine"
bomb.Position = pos

sound.Parent = bomb
sound:Play()

explosion:Stop()

local mesh = Instance.new("SpecialMesh")
mesh.MeshId = "http://www.roblox.com/asset/?id=28511843"
mesh.TextureId = "http://www.roblox.com/asset/?id=28512114"
mesh.Parent = bomb

local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = bomb

local script = Tool.BombBlink:clone()
script.Parent = bomb
script.Disabled = false

bomb.Parent = game.Workspace
bomb.Touched:connect(function(part)
if part ~= Tool.Handle and part.Parent:FindFirstChild("Humanoid") == nil then
bomb.Anchored = true
bomb.CanCollide = false
end
end)

end

function blowUp()

local e = Instance.new("Explosion")
e.BlastPressure = 12000
e.BlastRadius = 12
e.Parent = game.Workspace
e.Position = bomb.Position
sound:Stop()
explosion.Parent = e
explosion:Play()
bomb:remove()

end


Tool.Enabled = true
function onActivated()

if not Tool.Enabled then
return
end

Tool.Enabled = false

local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end

local targetPos = humanoid.TargetPoint

if planting then
plant(Tool.Handle.Position)
planting = false
else
blowUp()
planting = true
end

Tool.Enabled = true
end


script.Parent.Activated:connect(onActivated)

Thanks:D
Report Abuse
xSIXxBasicPlayer is not online. xSIXxBasicPlayer
Joined: 07 Nov 2010
Total Posts: 26
17 Apr 2012 11:27 AM
Scripting Helpers.
Report Abuse
Jas1066 is not online. Jas1066
Joined: 11 Jun 2010
Total Posts: 647
18 Apr 2012 10:43 AM
Bump?
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
18 Apr 2012 03:37 PM
FREE MODEL VIRUS INBOUND



~Techboy6601: The IDE guy~
Report Abuse
sam6175 is not online. sam6175
Joined: 16 Aug 2008
Total Posts: 1391
18 Apr 2012 04:42 PM
Here is a hint: Wait(10)
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Apr 2012 06:08 PM
Don't help him.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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