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: How would i make my sword

Previous Thread :: Next Thread 
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
13 Jan 2016 06:10 PM
Take Dmg only when its clicked?

I made this but its still taking dmg When not clicked

function overhead()
local deb = false
local fd = tool:FindFirstChild('OverheadAnim2')
local humanoid = tool.Parent:FindFirstChild('Humanoid')
if fd and humanoid then
local Lp = humanoid:LoadAnimation(fd)
if Lp then
Lp:Play()
local deb = false
script.Parent.Handle.Touched:connect(function(hi)
if deb then return end
deb = true
local hit = hi.Parent:FindFirstChild('Torso')
if hit then
if hit.Parent.Humanoid then
local f = hit.Parent:FindFirstChild('Humanoid')
if f then
f:TakeDamage(20)
if f.Health < 1 then
local y = stats:WaitForChild('Exp')
y.Value = y.Value + 30
end
end
end
end
wait(5)
deb = false
end)
end
end
end




http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$446 Tx337 (づ ゚ ³ ゚)づ
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
13 Jan 2016 07:56 PM
hg



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$481 Tx347 (づ ゚ ³ ゚)づ
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
13 Jan 2016 08:19 PM
omg

instead of constantly doing

if something then
...
if somethingelse then
...
end
end

do

if not something then
return
end

if not somethingelse then
return
end
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
13 Jan 2016 08:23 PM
but y doe

my script is clean :(



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$481 Tx347 (づ ゚ ³ ゚)づ
Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
13 Jan 2016 08:48 PM
make a debounce
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
13 Jan 2016 08:54 PM
"make a debounce"

>local deb = false



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$481 Tx347 (づ ゚ ³ ゚)づ
Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
13 Jan 2016 09:07 PM
1 thing that caught my eye unrelated to your question
if deb then return end
deb = true
Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
13 Jan 2016 09:07 PM
Nvm that's just my brain doing random stuff
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