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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 13 Jan 2016 09:07 PM |
| Nvm that's just my brain doing random stuff |
|
|
| Report Abuse |
|
|