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: :remove()?

Previous Thread :: Next Thread 
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 04:53 PM

how would i :remove() The fire part from workspace? after its done the damage?

repeat coroutine.yield() until game.Players.LocalPlayer.Character

local player = game.Players.LocalPlayer
local char = player.Character
function GetBullet()
local p = game.ReplicatedStorage.Main.Projectiles.Fire:Clone()
p.CanCollide = false
p.Parent = game.Workspace
Instance.new("BodyVelocity",p)
return p
end
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
local mH = mouse.Hit
local bullet = GetBullet()
bullet.CFrame = script.Parent.Handle.CFrame * CFrame.new(char.Torso.CFrame.lookVector * 2)
bullet.CFrame = CFrame.new(bullet.Position, mH.p)
bullet.BodyVelocity.velocity = bullet.CFrame.lookVector * 120
wait(5)
bullet:remove()


bullet.Touched:connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
local name = player.Character.Name
if humanoid then
if hit.Parent.Name ~= name then
humanoid:TakeDamage(10)



end
end
end)
end)
end)




Hi Wanna Be friends?
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 05:05 PM
B please someone help a noob in need...



Hi Wanna Be friends?
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
09 Jan 2016 05:13 PM
game.Debris:AddItem(fire, 6)



http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
09 Jan 2016 05:14 PM
oh after damage:
After:
"humanoid:TakeDamage(10)" put:
p:Destroy()



http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jan 2016 05:15 PM
You don't. You :Destroy it.
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 05:23 PM
Why do we destroy it might I ask? Whats the difference?


(I should be using the wiki to answer this but my internet is slow as crap... sorry for the inconvenience!)



Hi Wanna Be friends?
Report Abuse
irrupted is not online. irrupted
Joined: 30 Jul 2015
Total Posts: 13
09 Jan 2016 05:27 PM
remove is deprecated and inefficient
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 05:55 PM
"p:destroy()"


Unknown global 'p'


How do I fix it?



#code Print("I'm a noob at scripting")



Hi Wanna Be friends?
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:04 PM
b



Report Abuse
icekiller8002 is not online. icekiller8002
Joined: 22 Jan 2013
Total Posts: 6636
09 Jan 2016 06:13 PM
:Destroy() not :destroy() lol



icekiller8002 > dinosaur hat n00b
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
09 Jan 2016 06:14 PM
replace p with player

p is sometimes used as a variable to define player but you defined the player as 'player' and not p


Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:15 PM
Im trying to remove the Fire, not the player.



#code --[[wot]]--
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:16 PM
@Icekiller8002 I know, Tried it but unknown global event 'p'



#code --[[wot]]--
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:20 PM
w8 nvm I was being stupid.



#code --[[wot]]--
Report Abuse
Iplaydev is not online. Iplaydev
Joined: 19 Dec 2011
Total Posts: 292
09 Jan 2016 06:23 PM
wrong kind-o forum

my FACEEE
Report Abuse
Iplaydev is not online. Iplaydev
Joined: 19 Dec 2011
Total Posts: 292
09 Jan 2016 06:24 PM
o god i was dumb
this isn't OT
sorry 'right' forum

my FACEEE
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:24 PM
q.q its still not working.... Unknown global event 'p'



#code --[[wot]]--
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
09 Jan 2016 06:26 PM

repeat coroutine.yield() until game.Players.LocalPlayer.Character

local player = game.Players.LocalPlayer
local char = player.Character
function GetBullet()
p = game.ReplicatedStorage.Main.Projectiles.Fire:Clone()
p.CanCollide = false
p.Parent = game.Workspace
Instance.new("BodyVelocity",p)
return p
end
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
local mH = mouse.Hit
local bullet = GetBullet()
bullet.CFrame = script.Parent.Handle.CFrame * CFrame.new(char.Torso.CFrame.lookVector * 2)
bullet.CFrame = CFrame.new(bullet.Position, mH.p)
bullet.BodyVelocity.velocity = bullet.CFrame.lookVector * 120
wait(5)
bullet:remove()

bullet.Touched:connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
local name = player.Character.Name
if humanoid then
if hit.Parent.Name ~= name then
humanoid:TakeDamage(10)
p:Destroy()
end
end
end)
end)
end)



#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217")
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:28 PM
Bullet:remove() isnt meant to be there


also p:destroy() isnt working..
the part is still in workspace.



#code --[[wot]]--
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
09 Jan 2016 06:30 PM
Instead of

"wait(5)
bullet:remove()"

do:

wait(5)
p:Destory()



#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217")
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
09 Jan 2016 06:32 PM
typo:
"Destory" should be Destroy* ;)



#Code print("Song Link: http://www.roblox.com/Deorro-vs-Swedish-House-Mafia-Save-The-5-Hours-item?id=340827217")
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:39 PM
That only removes it IF it hits a humanoid, I want it to remove regardless.


I can't figure it out.



#code --[[wot]]--
Report Abuse
NumerousSpaces is not online. NumerousSpaces
Joined: 25 Dec 2013
Total Posts: 1077
09 Jan 2016 06:40 PM
I like your skin, Dude!


This Post is Pointless
Report Abuse
Guest1344545 is not online. Guest1344545
Joined: 03 Nov 2014
Total Posts: 150
09 Jan 2016 06:48 PM
Someone ;-;?



#code --[[wot]]--
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