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: how do I make it so that there's a cooldown after (inside)

Previous Thread :: Next Thread 
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 12:03 AM
you press b there's like a 4 second cooldown

i'm trying to learn lua and so yeah, i'm making a magic game w/ magic tools and this is what i have so far

would be helpful too if somebody could tell me how to apply the venomshank's venom (DoT) ability in Snakebite

function Snakebite()
local brick = Instance.new("Part")
brick.Parent = game.Workspace
brick.Name = "Venom"
brick.Size = Vector3.new(10,10,10)
brick.BrickColor = BrickColor.Green()
end

local tool = script.Parent
tool.Selected:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "b" then
print("The poison is sinking into our victim!")
Snakebite()

end
end)
end)
print 'The Magic is Online!'
function Magic()
print("Arcane Arts trying to launch!")
print("They areee trying to laaaunch!")
end

Magic()



Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
10 Feb 2014 12:05 AM
local cooldown = false

function Snakebite()
local brick = Instance.new("Part")
brick.Parent = game.Workspace
brick.Name = "Venom"
brick.Size = Vector3.new(10,10,10)
brick.BrickColor = BrickColor.Green()
end

local tool = script.Parent
tool.Selected:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "b" and (not cooldown) then
cooldown = true
print("The poison is sinking into our victim!")
Snakebite()
wait(4)
cooldown = false
end
end)
end)
print 'The Magic is Online!'
function Magic()
print("Arcane Arts trying to launch!")
print("They areee trying to laaaunch!")
end

Magic()
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 12:08 AM
Thanks Jake, appreciate it, couldn't find out how to do that for quite some time

Now if only I can find out how to apply the venom from a venomshank into here..
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
10 Feb 2014 12:23 AM
Just make another script that slowly degenerates the humanoids health, or make a coroutine.
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 04:39 PM
Would I have to use onTouch so that when it's touched, the humanoid slowly loses hp, and add a wait?

I hope it is, because then I know what to do.
Report Abuse
Solsticedev is not online. Solsticedev
Joined: 02 Feb 2014
Total Posts: 343
10 Feb 2014 04:40 PM
What is this "lua" you speak of? Roblox only runs on Lua :|
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 04:44 PM
lol, yeah. I was kind of sleepy when I posted this, I was kind of sleepy. Apologies. @solstice
Report Abuse
Solsticedev is not online. Solsticedev
Joined: 02 Feb 2014
Total Posts: 343
10 Feb 2014 04:44 PM
It is fine. Also nice primary group :|
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 04:47 PM
@Sol,


It's for when I go foruming on other forums besides this.

And I just saw my mistake in the last post, I said I was tired 2 times, 2nd time meant that I went to bed soon after that.
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 05:25 PM
i have a new problem, how do I make it so that every time you touch the block, you lose 20 health?

i'm trying to use onTouched to make it so that every time you touch it you lose 20 hp

i'm sorry if this troubles the people here, I just would like to know
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
10 Feb 2014 05:30 PM
block = Pathway to block (example: script.Parent.Parent)
db = false
t = 5 --Change 5 to how long before the block can be touched again

function hit(h)
if h.Parent:findFirstChild("Humanoid") then
if db == false then
db = true
h.Parent.Humanoid.Health = h.Parent.Humanoid.Health-20
wait(t)
db = false
end
end
end

block.Touched:connect(hit)
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 05:46 PM
@Xtreme,


What do I do with that?

As I've changed the pathway to block into what's inside the example

But I don't get it, explain please?
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
10 Feb 2014 05:56 PM
The block's pathway is basically where it is. If its parented to the script it would be script.Parent

Also, that was the script you asked for...to remove 20 health everytime someone touches a block...
Report Abuse
Mico161lol is not online. Mico161lol
Joined: 30 Oct 2009
Total Posts: 4769
10 Feb 2014 06:25 PM
Oh, I know, I just didn't get the example part.. heheh. It actually clarified it up
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