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 paintball script

Previous Thread :: Next Thread 
Plasma8 is not online. Plasma8
Joined: 23 Sep 2008
Total Posts: 16
22 Feb 2012 10:25 PM
ball = script.Parent

damage = 10







function onTouched(hit)

local humanoid = hit.Parent:findFirstChild("Humanoid")

-- make a splat

for i=1,3 do

local s = Instance.new("Part")

s.Shape = 1 -- block

s.formFactor = 2 -- plate

s.Size = Vector3.new(1,.4,1)

s.BrickColor = ball.BrickColor

local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))

s.Velocity = 25 * v

s.CFrame = CFrame.new(ball.Position + v, v)

ball.BrickCleanup:clone().Parent = s

s.BrickCleanup.Disabled = false

s.Parent = game.Workspace



end





if humanoid ~= nil then

tagHumanoid(humanoid)

humanoid.Health = humanoid.Health - damage

wait(2)

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(2)

ball.Parent = nil
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
22 Feb 2012 10:27 PM
Copied much?
Report Abuse
AdamantTale is not online. AdamantTale
Joined: 03 Apr 2010
Total Posts: 250
22 Feb 2012 10:40 PM
The spacing is horrible! Just saying...
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
22 Feb 2012 10:44 PM
It's free modeled bro -_-
Report Abuse
EMAN381Fan is not online. EMAN381Fan
Joined: 12 Feb 2009
Total Posts: 112
23 Feb 2012 05:53 AM
humanoid:TakeDamage(damage)?
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
23 Feb 2012 06:08 AM
@above

humanoid:TakeDamage(damage)
is the same as
humanoid=humanoid-damage

where damage is 10 because its defined in the very first lines
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