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: "Gun" script help

Previous Thread :: Next Thread 
niels22 is not online. niels22
Joined: 23 Jan 2009
Total Posts: 700
19 Feb 2012 09:02 AM
Hello there.

So I've been messing with this damage script for hours (lame) and can't get it to work.
Source:
-------------------------------------------
CD = true
B = script.Parent
player = script.P.Value

function Touched(hit)
if CD == true then
if hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") and CD == true then
if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor ~= player.TeamColor then
hit.Parent.Humanoid:TakeDamage(math.random(5,10))
end
end
if hit.Parent:findFirstChild("H") then
if player.TeamColor ~= game.Teams["Train Team"].TeamColor then
hit.Parent.H.Value = hit.Parent.H.Value - math.random(5,10)
print(hit.Parent.H.Value)
end
end
B.BodyForce:Destroy()
script:Remove()
end
CD = false
end

B.Touched:connect(Touched)
-------------------------------------------------
The script is placed in the bullet
P is defined (value is set to my player)
H is a child of the target
Train Team is exicting in game.Teams

What is wrong?
Report Abuse
niels22 is not online. niels22
Joined: 23 Jan 2009
Total Posts: 700
19 Feb 2012 10:29 AM
Serious no help?
Report Abuse
niels22 is not online. niels22
Joined: 23 Jan 2009
Total Posts: 700
20 Feb 2012 08:53 AM
Still no help... bump!... did you hear that?
Report Abuse
niels22 is not online. niels22
Joined: 23 Jan 2009
Total Posts: 700
20 Feb 2012 11:00 AM
Great, I'll just completely rescript it tommorow.
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