xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 12 Mar 2016 08:14 AM |
im not sure how i can stop it from doing it
i know i can use debounce but im calling it in a place with debounce used the function is still going thour
function dmg() local ab = char:FindFirstChild('Box') if not ab then print "Weld not found to take Dmg" return end ab.Touched:connect(function(hit) if hit.Parent.Humanoid then local hi = hit.Parent.Humanoid hi.Health = hi.Health - 10 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$234 Tx314 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|
os_time
|
  |
| Joined: 15 Feb 2014 |
| Total Posts: 2247 |
|
|
| 12 Mar 2016 08:15 AM |
debounce in touched func
#code "Lua ~ PHP ~ CSS ~ HTML for me at least." |
|
|
| Report Abuse |
|
|
hypur
|
  |
| Joined: 22 May 2015 |
| Total Posts: 17043 |
|
| |
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 12 Mar 2016 08:34 AM |
even with debounce welded weapon still takes dmg
function dmg() local ab = char:FindFirstChild('Box') if not ab then print "Weld not found to take Dmg" return end local no = false if no == false then ab.Touched:connect(function(hit) no = true if hit.Parent.Humanoid then local hi = hit.Parent.Humanoid hi.Health = hi.Health - 10 end end) wait(2) no = false end end
local deb = false Mouse.Button1Down:connect(function() if deb == true then return end deb = true print '[1]'
local ww = char:FindFirstChild("weaponweld") if not ww then print 'Weld Not found' return end print '[3]' if equip == true then local humanoid = char.Humanoid local id = "http://www.roblox.com/item.aspx?id=379808788"--Change the Id to want u want local ani = Instance.new("Animation")
dmg()
print '[4]'
ani.AnimationId = id
local loadAnimation = humanoid:LoadAnimation(ani) loadAnimation:Play() print '[5]' end wait(2) deb = false end)
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$234 Tx314 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|
os_time
|
  |
| Joined: 15 Feb 2014 |
| Total Posts: 2247 |
|
|
| 12 Mar 2016 08:47 AM |
function dmg() local ab = char:FindFirstChild('Box') if not ab then print "Weld not found to take Dmg" return end ab.Touched:connect(function(hit) if hit.Parent.Humanoid and not no then no = true local hi = hit.Parent.Humanoid hi.Health = hi.Health - 10 wait(2) no = nil end end) end end
Something like that typing on mobile is a pain
#code "Lua ~ PHP ~ CSS ~ HTML for me at least." |
|
|
| Report Abuse |
|
|
Dev_Ryan
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 243 |
|
|
| 12 Mar 2016 08:48 AM |
The debounce needs to be inside the connection.
Here is what I mean:
function dmg() local ab = char:FindFirstChild('Box') local debounce = false if not ab then print "Weld not found to take Dmg" return end ab.Touched:connect(function(hit) if hit.Parent.Humanoid and not debounce then debounce = true local hi = hit.Parent.Humanoid hi.Health = hi.Health - 10 wait(1) debounce = false end end) end |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 12 Mar 2016 10:30 AM |
alright thxs for the help
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$234 Tx314 (づ ゚ ³ ゚)づ |
|
|
| Report Abuse |
|
|