|
| 29 Mar 2015 01:42 AM |
been strugling to find a solution but well here it is:
its a tycoon drop-script that generates the brick that gives money and i want the brick that it generates named TycoonBrick to be removed after 5 minutes (so that if it glitches outside of it it will auto remove)
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,0.4) p.BrickColor = BrickColor.new(37) p.BottomSurface = 0 p.TopSurface = 0 p.Name = "TycoonBrick" p.Parent = script.Parent wait (5) p.remove() ---the line ive been trying delete it if its totally wrong end
while true do wait(2) fire() end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Vichron
|
  |
| Joined: 02 Aug 2014 |
| Total Posts: 10069 |
|
| |
|
Vichron
|
  |
| Joined: 02 Aug 2014 |
| Total Posts: 10069 |
|
|
| 29 Mar 2015 01:47 AM |
function fire() local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,0.4) p.BrickColor = BrickColor.new(37) p.BottomSurface = 0 p.TopSurface = 0 p.Name = "TycoonBrick" p.Parent = script.Parent wait(5) --you had it wait (5) p:remove() --p:remove() not p.remove() end
while true do wait(2) fire() end
|
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 01:53 AM |
u know it has a wait(2) fire()
so the drop spawns a brick and then waits 5 seconds and removes the brick and then it wait another 2 seconds to do again since its while true do |
|
|
| Report Abuse |
|
|
| |
|
Seviro
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 46758 |
|
|
| 29 Mar 2015 02:01 AM |
well (5) is 5 seconds
try 300 |
|
|
| Report Abuse |
|
|
Pyrante
|
  |
| Joined: 22 Nov 2014 |
| Total Posts: 6616 |
|
|
| 29 Mar 2015 02:02 AM |
can you even do function fire?
if so,
function fire() --can you evn function on fire local p = Instance.new("Part") p.Position = script.Parent.Position p.Size = Vector3.new(1,1,0.4) --so small dude p.BrickColor = BrickColor.new ("Bright red") --has to be a legit color p.BottomSurface = 0 p.TopSurface = 0 p.Anchored = false --add this if the brick is meant to drop or something p.Name = "TycoonBrick" p.Parent = script.Parent wait(5) --don't put a space p:destroy() --remove < destroy, destroy is more reliable end
while true do wait(2) fire() wait (1) --second wait time prevents glitches in my opinion. end |
|
|
| Report Abuse |
|
|
bluefredy
|
  |
| Joined: 23 Oct 2010 |
| Total Posts: 59243 |
|
|
| 29 Mar 2015 02:02 AM |
local Run = true
function FirePart() local Part = Instance.new("Part", script.Parent) Part.Name = "TycoonPart" Part.BrickColor = BrickColor.new("INSERT COLOR HERE, IE; Bright blue") Part.Position = script.Parent.Position Part.Size = Vector3.new(1, 1, 1) Part.BottomSurface = 0 Part.TopSurface = 0 wait(5) if script.Parent:FindFirstChild("TycoonPart") then Part:Destroy() end end
while Run do wait(2) FirePart() end
idk, try that |
|
|
| Report Abuse |
|
|
Pyrante
|
  |
| Joined: 22 Nov 2014 |
| Total Posts: 6616 |
|
|
| 29 Mar 2015 02:03 AM |
function firepart()
I guess you can do a function bluefredy() too right |
|
|
| Report Abuse |
|
|
bluefredy
|
  |
| Joined: 23 Oct 2010 |
| Total Posts: 59243 |
|
| |
|
SirIsOP
|
  |
| Joined: 03 Jul 2012 |
| Total Posts: 1201 |
|
|
| 29 Mar 2015 02:04 AM |
wish i could help.
I made my name with the word sir, so when I get called sir i feel superior #justcoolkidthings |
|
|
| Report Abuse |
|
|
bluefredy
|
  |
| Joined: 23 Oct 2010 |
| Total Posts: 59243 |
|
|
| 29 Mar 2015 02:08 AM |
"function fire() --can you evn function on fire"
yes, it's a user created function
"p.Size = Vector3.new(1,1,0.4) --so small dude"
the problem would be that it's not a Custom part for that
"p.BrickColor = BrickColor.new ("Bright red") --has to be a legit color"
no it doesn't
"p.Anchored = false --add this if the brick is meant to drop or something"
parts aren't anchored in the first place on Instance.new
"second wait time prevents glitches in my opinion."
while loops only need one wait() |
|
|
| Report Abuse |
|
|
Pyrante
|
  |
| Joined: 22 Nov 2014 |
| Total Posts: 6616 |
|
|
| 29 Mar 2015 02:10 AM |
see blue this is why i'm hardly experienced in scripting
but ya, i make my own scripts work somehow so
|
|
|
| Report Abuse |
|
|
bluefredy
|
  |
| Joined: 23 Oct 2010 |
| Total Posts: 59243 |
|
|
| 29 Mar 2015 02:12 AM |
oh just read that you wanted it to delete after 5 minutes
okay, in my script i created
change the wait(5) to wait(300) or something, usually for minutes i just do wait(60) * 5 or something to make it easier on myself |
|
|
| Report Abuse |
|
|
devDave
|
  |
| Joined: 28 Nov 2013 |
| Total Posts: 7287 |
|
|
| 29 Mar 2015 02:20 AM |
| this thread is cancer along with bluefredy |
|
|
| Report Abuse |
|
|
bluefredy
|
  |
| Joined: 23 Oct 2010 |
| Total Posts: 59243 |
|
| |
|
devDave
|
  |
| Joined: 28 Nov 2013 |
| Total Posts: 7287 |
|
|
| 29 Mar 2015 02:23 AM |
sorry if that was rude, i just watched interstellar and my head hurts and i think im crying
time for withdrawal |
|
|
| Report Abuse |
|
|
| |
|
devDave
|
  |
| Joined: 28 Nov 2013 |
| Total Posts: 7287 |
|
| |
|
Incipius
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 1806 |
|
|
| 29 Mar 2015 02:25 AM |
all u have to do is slam your face into keyboard
and boom ur op scripter |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 02:29 AM |
Remove() shouldn't be used at all use Destroy() instead
" destroy is more reliable"
no.
"wait (1) --second wait time prevents glitches in my opinion."
in your...opinion? what the hell? it either does or it doesnt
it doesnt
"local Run = true"
use god damn camelCase plz kthnx
also what is that supposed to do???
also you're supposed to post the output
"wait (5)"
wait(5)*
wait() takes an argument of seconds.
in addition this is not the correct way to go about this.
it will delay it by 5 seconds but not properly
you have two options
1. use delay() or debris:AddItem() (which might use Remove()) or spawn() or ugly coroutines
2. make a part put it in ServerStorage put a wait(5) script.Parent:Destroy() script in it and just clone it, which would be cleaner than creating a new part anyway |
|
|
| Report Abuse |
|
|