Warfelz
|
  |
| Joined: 09 Jun 2013 |
| Total Posts: 2 |
|
|
| 21 Jun 2013 07:53 AM |
I have this attack and I tried adding wait(5) to the places I think will make it have a cooldown but it doesn't work. Also I'm not a great scripter so help is really appreciated. Thank you!
Here is the script:
if script.Parent.className ~= "HopperBin" then local h = Instance.new("HopperBin") h.Name = "wsd" h.Parent = game.Players.ws.Backpack script.Parent = h end
function ClusterBombPiece(mis, tar, misg, misv) while mis.Parent == Workspace and tar:IsDescendantOf(Workspace) do wait() misg.cframe = CFrame.new(tar.Position, mis.Position) misv.velocity = mis.CFrame.lookVector * -250 end end
bin = script.Parent player = bin.Parent.Parent.Character colors = {"Bright blue"} function onClicked (mouse) for i = 1,20 do wait() local bul = Instance.new("Part") bul.formFactor = "Symmetric" bul.Shape = "Ball" bul.Size = Vector3.new(math.random(1,2),math.random(1,2),math.random(1,2)) local cr = math.random(1,#colors) local color = colors[cr] bul.BrickColor = BrickColor.new(color) bul.Transparency = .5 bul.CanCollide = true bul.TopSurface = 0 bul.BottomSurface = 0 bul.CFrame = player.Torso.CFrame * CFrame.new(0,0,-5) bul.Parent = Workspace local bulv = Instance.new("BodyVelocity") bulv.maxForce = Vector3.new(math.huge,math.huge,math.huge) bulv.velocity = CFrame.new(player.Torso.Position, mouse.Hit.p).lookVector * (200) bulv.Parent = bul bul.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") ~= nil then if hit.Parent.Name ~= player.Name then hit.Parent.Humanoid:TakeDamage(5) bul:remove() end end end) game:GetService("Debris"):AddItem(bul, .7) end end
function onSelected (mouse) mouse.Button1Down:connect(function() onClicked (mouse) end) mouse.KeyDown:connect(function(key) if key == "z" then bin.Name = "Mud-slap" elseif key == "x" then bin.Name = "Take Down" elseif key == "c" then bin.Name = "Mud Sport" elseif key == "v" then bin.Name = "Water Gun" end end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
petro180
|
  |
| Joined: 30 Mar 2009 |
| Total Posts: 354 |
|
|
| 21 Jun 2013 08:20 AM |
cooldown = false --Add a Boolean.
if script.Parent.className ~= "HopperBin" then local h = Instance.new("HopperBin") h.Name = "wsd" h.Parent = game.Players.ws.Backpack script.Parent = h end
function ClusterBombPiece(mis, tar, misg, misv) while mis.Parent == Workspace and tar:IsDescendantOf(Workspace) do wait() misg.cframe = CFrame.new(tar.Position, mis.Position) misv.velocity = mis.CFrame.lookVector * -250 end end
bin = script.Parent player = bin.Parent.Parent.Character colors = {"Bright blue"} function onClicked (mouse) if cooldown = false then cooldown = true for i = 1,20 do wait() local bul = Instance.new("Part") bul.formFactor = "Symmetric" bul.Shape = "Ball" bul.Size = Vector3.new(math.random(1,2),math.random(1,2),math.random(1,2)) local cr = math.random(1,#colors) local color = colors[cr] bul.BrickColor = BrickColor.new(color) bul.Transparency = .5 bul.CanCollide = true bul.TopSurface = 0 bul.BottomSurface = 0 bul.CFrame = player.Torso.CFrame * CFrame.new(0,0,-5) bul.Parent = Workspace local bulv = Instance.new("BodyVelocity") bulv.maxForce = Vector3.new(math.huge,math.huge,math.huge) bulv.velocity = CFrame.new(player.Torso.Position, mouse.Hit.p).lookVector * (200) bulv.Parent = bul bul.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") ~= nil then if hit.Parent.Name ~= player.Name then hit.Parent.Humanoid:TakeDamage(5) bul:remove() end end end) game:GetService("Debris"):AddItem(bul, .7) end end wait(5) --5 second wait time cooldown = false --Cooldown is now false. end
function onSelected (mouse) mouse.Button1Down:connect(function() onClicked (mouse) end) mouse.KeyDown:connect(function(key) if key == "z" then bin.Name = "Mud-slap" elseif key == "x" then bin.Name = "Take Down" elseif key == "c" then bin.Name = "Mud Sport" elseif key == "v" then bin.Name = "Water Gun" end end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|