Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pellet = script.Parent
- damage = 1
- local debounce = false
- function onTouched(hit)
- if debounce == false then
- debounce = true
- if welded == false and hit.Parent:findFirstChild("Arrow") == nil then stick(hit) end
- humanoid = hit.Parent:findFirstChild("Enemy")
- if humanoid~=nil then
- tagHumanoid(humanoid)
- humanoid.Health = humanoid.Health - damage
- wait(2)
- untagHumanoid(humanoid)
- else
- wait(2)
- connection:disconnect()
- end
- end
- debounce = false
- end
- function tagHumanoid(humanoid)
- -- todo: make tag expire
- local tag = pellet:findFirstChild("creator")
- if tag ~= nil then
- local new_tag = tag:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- connection = pellet.Touched:connect(onTouched)
- wait(1)
- if welded then wait(1) end
- pellet.Parent = nil
- BCGamesSH is not online. BCGamesSH
- Joined: 03 May 2012
- Total Posts: 21
- #67,464,741 - 05-04-2012 09:29 AM
- Ok. Your error lies within a misplace debounce change.
- This is how your format is:
- local db = false
- function blah()
- if db == false then
- db = true
- -- blahhh
- end
- db = false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement