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: Weapon Upgrades

Previous Thread :: Next Thread 
DeVinci is not online. DeVinci
Joined: 21 Jul 2010
Total Posts: 338
14 Apr 2012 08:03 PM
Not only can you purchase ammo, you can buy damage upgrades to make your weapon more powerful. But it, too, doesn't want to work. >:\

Heres the code:

ball = script.Parent
damage = script.Parent.Damage.Value



function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Zombie")
if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid.Health = humanoid.Health - damage
wait(.1)
untagHumanoid(humanoid)
end
connection:disconnect()
ball.Parent = nil
end
function tagHumanoid(humanoid)
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



Theres no damage done... what so ever.
Report Abuse
DeVinci is not online. DeVinci
Joined: 21 Jul 2010
Total Posts: 338
14 Apr 2012 08:23 PM
That is a script inside the pistol itself. (Pistol > This Script)
Report Abuse
DeVinci is not online. DeVinci
Joined: 21 Jul 2010
Total Posts: 338
14 Apr 2012 09:15 PM
Could really use some help...
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
14 Apr 2012 09:18 PM
Shooting players?
Report Abuse
DeVinci is not online. DeVinci
Joined: 21 Jul 2010
Total Posts: 338
14 Apr 2012 09:32 PM
Nope, zombies.
Report Abuse
littlebro346 is not online. littlebro346
Joined: 13 Dec 2008
Total Posts: 468
14 Apr 2012 10:41 PM
the very last line

ball.Parent = nil

shouldn't that be

ball.Parent == nil
Report Abuse
DeVinci is not online. DeVinci
Joined: 21 Jul 2010
Total Posts: 338
14 Apr 2012 10:53 PM
Nope. Didnt Work
Report Abuse
littlebro346 is not online. littlebro346
Joined: 13 Dec 2008
Total Posts: 468
14 Apr 2012 10:53 PM
well thats all i got, take away super awesome scripters! :P
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