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 » Scripters
Home Search
 

Re: Destroy Object after hit

Previous Thread :: Next Thread 
Paintertable is not online. Paintertable
Joined: 10 Jul 2013
Total Posts: 179
01 Jul 2017 09:05 AM
any idea how i would destroy the Ball after it hit something?.

here the script :

local ten = true

elec.Touched:connect(function(hit)
if not ten then return end
ten = false
local ehum = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid")
if ehum and ehum ~= hum then
for i = 1,10 do
local part = elec:clone()
part.Size = Vector3.new(0.5,0.5,0.5)
part.CFrame = elec.CFrame
part.ParticleEmitter.LockedToPart = false
part.BodyVelocity.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
part.Parent = game.Workspace
game.Debris:AddItem(part,1)
end
ehum:TakeDamage(10)
elseif hit.Anchored == true and hit.CanCollide == true then
for i = 1,10 do
local part = elec:clone()
part.Size = Vector3.new(0.5,0.5,0.5)
part.CFrame = elec.CFrame
part.ParticleEmitter.LockedToPart = false
part.BodyVelocity.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
part.Parent = game.Workspace
game.Debris:AddItem(part,1)
end

end

wait()
ten = true


end)
Report Abuse
Paintertable is not online. Paintertable
Joined: 10 Jul 2013
Total Posts: 179
01 Jul 2017 09:19 AM
bump
Report Abuse
nullfeels is not online. nullfeels
Joined: 31 Mar 2017
Total Posts: 1215
01 Jul 2017 09:48 AM
Which parts the ball? XD Can you not just call Destroy() on it?
Report Abuse
Paintertable is not online. Paintertable
Joined: 10 Jul 2013
Total Posts: 179
03 Jul 2017 08:28 AM
the script is just to hard... NOT ABLE
Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
03 Jul 2017 08:32 AM
Ball.Touched:Connect(function()
Ball:Destroy()
end)
Report Abuse
EncryptionXYZ is not online. EncryptionXYZ
Joined: 25 Feb 2017
Total Posts: 133
03 Jul 2017 09:46 AM
ˢºᵐᵉ ʳºᵇˡºˣ ᵈᵘᵈᵉ
Report Abuse
GoldAngelInDisguise is not online. GoldAngelInDisguise
Joined: 29 Mar 2014
Total Posts: 84
03 Jul 2017 09:51 AM
Troller xD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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