|
| 02 Dec 2011 10:09 PM |
So I'm trying to make it so that a brick with this script takes random amounts of time to wait before regenerating, but it doesn't work...might there be something in the mathrandoms I need to change?
model = script.Parent messageText = ""
message = Instance.new("Message") message.Text = messageText backup = model:clone()
end
while true do wait(0.1) m = math.random(1,4) if m == 1 then wait(0.7) message.Parent = game.Workspace model:remove()
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil) else if m == 2 then wait(0.9) message.Parent = game.Workspace model:remove()
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil else if m == 3 then wait(1.1) message.Parent = game.Workspace model:remove()
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil) else if m == 4 then wait(1.3) message.Parent = game.Workspace model:remove()
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil end end end end end |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2011 10:24 PM |
All I did is just put the end's where they belong... model = script.Parent messageText = ""
message = Instance.new("Message") message.Text = messageText backup = model:clone()
while true do wait(0.1) m = math.random(1,4) if m == 1 then wait(0.7) message.Parent = game.Workspace model:remove() end
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil else if m == 2 then wait(0.9) message.Parent = game.Workspace model:remove() end
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil else if m == 3 then wait(1.1) message.Parent = game.Workspace model:remove() end
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil else if m == 4 then wait(1.3) message.Parent = game.Workspace model:remove() end
wait(0.1)
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil end |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2011 10:39 PM |
| Greatt suggestion, but it didn't work. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Dec 2011 07:44 AM |
I decided to try this, but it still doesn't work...
bricks = script.Parent backup = bricks:clone() message = Instance.new("Message") message.Text = ""
while true do print("Regen") m = math.random(1,4) wait(0.01) if m = 1 then wait(0.8) bricks:Remove() message.Parent = game.Workspace wait(0.01) bricks = backup:clone() bricks:makeJoints message:Remove() end
if m = 2 then wait(1) bricks:Remove() message.Parent = game.Workspace wait(0.01) bricks = backup:clone() bricks:makeJoints message:Remove() end
if m = 3 then wait(1.2) bricks:Remove() message.Parent = game.Workspace wait(0.01) bricks = backup:clone() bricks:makeJoints message:Remove() end
if m = 4 then wait(1.4) bricks:Remove() message.Parent = game.Workspace wait(0.01) bricks = backup:clone() bricks:makeJoints message:Remove() end
end |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Dec 2011 01:56 PM |
Change to "if WhatEverNumber == m then"
Use two ='s when comparing... |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2011 01:57 PM |
| Also it's "brick:makeJoints()" Not "brick:makeJoints"... |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2011 02:00 PM |
Can't believe I forgot to do that... but it's still not working... |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2011 02:00 PM |
| Wait, I think it works now! Thanks :D |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Dec 2011 02:13 PM |
| Wait....the object's able to remove itself but it doesn't come back! ._. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Dec 2011 02:16 PM |
| Gah! It's still removing itself and not coming back! D: |
|
|
| Report Abuse |
|
|