Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 18 Jan 2014 11:47 PM |
Hey everyone, I'm working on these ki attacks for this project I'm working on. What I have here is a pretty basic damage script. What's weird is it works in a simulated server on Start Server->Start Player, but doesn't work in Online Mode. A script within the hopperbin generates the projectile, and then inserts the Damage script into the projectile. it is suppose to inflict damage upon impact, but it does not. Oh and I forgot to mention the "projectile" is anchored and is a cylinder that grows. Please help me fix this issue.
-Thanks, Gogeta.
ball = script.Parent damage = 69
function onTouched(hit) local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid ~= nil then tagHumanoid(humanoid) humanoid.Health = humanoid.Health - damage script.Parent:remove() wait() untagHumanoid(humanoid) end connection:disconnect() ball.Parent = nil end
function tagHumanoid(humanoid) -- todo: make tag expire local tag = ball: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 = ball.Touched:connect(onTouched)
wait(8) ball.Parent = nil
|
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
| |
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 19 Jan 2014 12:23 AM |
| I'm slowly melting into this chair stalking the forums and waiting for someone to help me. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 01:16 AM |
Try this one:
ball=script.Parent damage=69
function OnTouch(hit) local humanoid=hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then local tag=ball:findFirstChild("creator") if tag~=nil then local new_tag=tag:clone() new_tag.Parent=humanoid end
humanoid:TakeDamage(damage) ball:Destroy() wait()
if humanoid~=nil and tag~=nil then tag.Parent=nil connection:disconnect() ball.Parent=nil end end end
connection=ball.Touched:connect(OnTouch) wait(8) ball.Parent=nil
|
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 19 Jan 2014 09:35 PM |
| That script did not work, I really need help with this I've put hours into trial and error into this, I checked and the damage script is being inserted into the brick, it's just not apparently registering the collisions. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2014 09:45 PM |
| What works in solo usually works online if you replace the scripts with LocalScripts,since solo runs all scripts as if they were local... |
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 19 Jan 2014 09:55 PM |
| I changed the script to a local script and it is still not working. |
|
|
| Report Abuse |
|
|