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: Brick Remove Script

Previous Thread :: Next Thread 
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:11 PM
Hi I am wondering how to remove a brick from the game after it spawns into the game. Here is what i got building wise...

I am going to have a basic brick dropping brick creating new parts but i want those bricks to go away after a set amount of time since they will not fall out of the game.

How do i get those bricks to be removed after a set amount of time with out removing the brick spawner its self?

All help greatly appreciated.
Report Abuse
Pieguardian is not online. Pieguardian
Joined: 22 Jul 2008
Total Posts: 15807
03 Sep 2012 09:14 PM
while true do
wait(Seconds here)
script.Parent.Parent.script.BrickNameHere:destroy()
end


Don't count on that working. I know little about scripting.
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:15 PM
Same here, that is why i am asking... now were do i add that too? do i add that into the same script the brick dropper is using to create new parts or a seperate script entirely?
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
03 Sep 2012 09:18 PM
while wait(SECONDSHERE) do
local NewPart = Instance.new("Part", Workspace)
NewPart.Position = script.Parent.Size.Y/2 - 1
wait(SECONDSHERE)
NewPart:Destroy()
end
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:19 PM
Aslo how do i make my current script rename my new part to a specific name?
here is the script that i am currently using:

while true do
m = Instance.new("Part", Workspace)
m.Size = script.Parent.Size
m.Position = script.Parent.Position
m.BrickColor = BrickColor:random()
m.Friction = 0
wait(5)
end

So now i need to add a brick name to the new parts being made and a way to delete its bricks after creating them after so long
Report Abuse
Dozer86421 is not online. Dozer86421
Joined: 18 Aug 2011
Total Posts: 726
03 Sep 2012 09:19 PM
Add that into the brick dropper. If you had described what you wanted more, I could've made it much better. Also, this Post belongs more in the "Let's Make a Deal" Forum unless you wanna learn how to make it. This is a bit advanced for you. A bit very advanced. Slow down! Learn the basics!
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:21 PM
Dozer here is the script output i am getting with that script you have given me.

Workspace.Part.Script:3: bad argument #3 to '?' (Vector3 expected, got number)
19:17:52 - Script "Workspace.Part.Script", Line 3
19:17:52 - stack end
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:23 PM
How does this belong in lets make a deal forum this is scripting there for scripting helper but that doesnt matter, all i need is some help... I know how to script some but i learn by reading it and making sense of it. This isnt that advanced but is still slightly out of reach, there for the reason i am asking for help...
Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
03 Sep 2012 09:23 PM
while true do
m = Instance.new("part", Workspace)
m.Name = "WHATEVER NAME GOES HERE"
m.Size = script.Parent
m.Position = script.Parent.Position
m.BrickColor =BrickColor:random()
m.Friction = 0
wait(5)
end

--I think this'll work.
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:39 PM
Arlight so now i got the brick dropper renaming the bricks to what i want, now what do i add in this script to do like some wepons do with parts. where after the, lets say rocket for this, explodes it leaves little bricks all over as fragments. After a certian time they dissapear. but each of thos "fragments" have a script in them telling them to be removed after a certain time.

How do I add into the dropper script to do the following:
- Add a script into the new part it has just created
- This script that it has placed into the new part makes the new part be removed after a specified amount of time

Here is my current script so far:

while true do
m = Instance.new("Part", Workspace)
m.Size = script.Parent.Size
m.Name = "GamePT1"
m.Position = script.Parent.Position
m.BrickColor = BrickColor:random()
m.Friction = 0
wait(5)
NewPart:Destroy()
wait(1)

end
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:40 PM
Remove

NewPart:Destroy()
wait(1)


----------

This part does not work
Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
03 Sep 2012 09:43 PM
For the remove part it should be

GamePT1:Destroy()
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
03 Sep 2012 09:43 PM
while true do
m = Instance.new("Part", Workspace)
m.Size = script.Parent.Size
m.Name = "GamePT1"
m.Position = script.Parent.Position
m.BrickColor = BrickColor:random()
m.Friction = 0
wait(5)
GamePT1:Destroy() -- Wrong name
wait(1)

end
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
03 Sep 2012 09:44 PM
Late post >:(
Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
03 Sep 2012 09:47 PM
lol I beat you to it.

~Well how bout that~    
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
03 Sep 2012 09:48 PM
qq wai u mean
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 09:53 PM
Yep Spearman you did beat him to it and now i have it working greatly... One and last question... What do i insert into the script to make the new bricks deadly?
Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
03 Sep 2012 10:03 PM
Oh geez.
Let's see, enter another script into your new part

A lava brick script

Here it is

function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.Health = 0
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
03 Sep 2012 10:10 PM
while true do
m = Instance.new("Part", Workspace)
m.Parent = Workspace
m.Size = script.Parent.Size
m.Name = "GamePT1"
m.Position = script.Parent.Position
m.BrickColor = BrickColor:random()
m.Friction = 0
script.Parent.Touched:connect(function(kill)
local h = part.Parent:FindFirstChild("Humanoid")
if h~=nil then
h.Health = 0
end
end)
Report Abuse
CokeCody is not online. CokeCody
Joined: 31 Mar 2010
Total Posts: 394
03 Sep 2012 10:24 PM
You forgot something...

while true do
m = Instance.new("Part", Workspace)
m.Parent = Workspace
m.Size = script.Parent.Size
m.Name = "GamePT1"
m.Position = script.Parent.Position
m.BrickColor = BrickColor:random()
m.Friction = 0
script.Parent.Touched:connect(function(kill)
local h = part.Parent:FindFirstChild("Humanoid")
if h~=nil then
h.Health = 0
end
end)


script.Parent.Touched:connect(onTouched)

I'm not sure, a little tired.
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
03 Sep 2012 10:38 PM
Alright got it, thank you all so much for the help... I will post if i need any more help but i think i got it for now...

Once again thanks for the help
-flame210
Report Abuse
CokeCody is not online. CokeCody
Joined: 31 Mar 2010
Total Posts: 394
03 Sep 2012 10:40 PM
No problem.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
03 Sep 2012 11:03 PM
Uhh, the idiot who did Friction = 0 and BrickColor:random() ???? wth

script.Parent.Touched:connect(function()
m = Instance.new("Part", Workspace)
m.Name = "WHATEVER NAME GOES HERE"
m.Size = script.Parent
m.Position = script.Parent.Position
m.BrickColor =BrickColor.random()
wait(5)
end)


~Don't get mad as to what I said, get mad at me as a person
Report Abuse
CokeCody is not online. CokeCody
Joined: 31 Mar 2010
Total Posts: 394
03 Sep 2012 11:10 PM
Lolol, I wasn't going to say anything about BrickColor.random(). Didn't notice
Report Abuse
HEAT507 is not online. HEAT507
Joined: 31 Aug 2012
Total Posts: 429
04 Sep 2012 02:06 AM
always removing brick

c = game.ChildAdded:Connect:()

if c.className = 'Part' then

c:Remove() -- I think dat might have a err0r

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