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 » Scripting Helpers
Home Search
 

Re: Damage Inserted Into Brick upon Brick generation

Previous Thread :: Next Thread 
Gogeta is not online. 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 is not online. Gogeta
Joined: 25 Nov 2006
Total Posts: 583
19 Jan 2014 12:09 AM
Bump.
Report Abuse
Gogeta is not online. 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
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
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 is not online. 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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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