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
 

Help?

Previous Thread :: Next Thread 
ethanstar99 is not online. ethanstar99
Joined: 22 Nov 2008
Total Posts: 82
11 Sep 2012 04:45 PM
There is this script ive ben working on that is suposed to break after 3 or so bullet hits.
It does not work. Can you post the fixed script in the comments?
Also, is 85 a good total?

dm = 0
function onHit(part)
vX = math.abs(part.Velocity.x - script.Parent.Velocity.x)
vY = math.abs(part.Velocity.y - script.Parent.Velocity.y)
vZ = math.abs(part.Velocity.z - script.Parent.Velocity.z)
totalVelocity = vX + vY + vZ
if totalVelocity >= 85 then
dm = dm + 1
end

if dm >= 3 then
script.Parent.CanCollide = false
script.Parent.Sound:play()
wait (2)
script.Parent:remove()
end
end

script.Parent.Touched:connect(onHit)
Report Abuse
ethanstar99 is not online. ethanstar99
Joined: 22 Nov 2008
Total Posts: 82
12 Sep 2012 02:52 PM
Oh well. Everyone is to dumb to fix it.
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
12 Sep 2012 03:23 PM
So are you.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
12 Sep 2012 03:28 PM
A small infrmation. You know the whole script will run, even if it's not a bullet that touches it.
Report Abuse
ethanstar99 is not online. ethanstar99
Joined: 22 Nov 2008
Total Posts: 82
12 Sep 2012 04:19 PM
The brick is anchored and in mid-air. It looks like it is touching the building, but it is 0.2 studs away from it. It is a railing for a building.

Even if it runs while nothing is happening, It will retrun and wait for another bullet to hit. Just like lava.
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