|
For my pizza parlor, I need the grill to dissapear for a while, then come back. Why dosent this work?
function uponTouched(hit)
game.Workspace.grill:Remove ()
wait(10)
game.Workspace.grill:clone ()
end
script.Parent.Touched:connect(onTouched)
|
|
furnaceJoin Date: 2007-05-05 Post Count: 232 |
Probably because the name of your function is "uponTouched" when it should be "onTouched"... |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
You're right. Do this:
script.Parent.Touched:connect(uponTouched) |
|
|
Ok, done that, but the brick dosent come back. Whats wrong? |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
Here:
g = game.Workspace.grill:clone()
function uponTouched(hit)
game.Workspace.grill:Remove()
wait(10)
g.Parent = game.Workspace
end
script.Parent.Touched:connect(uponTouched)
You can't remove things and then expect them to come back by cloning. |
|
|
function uponTouched(hit)
game.Workspace.grill.Parent = nil
wait(10)
game.Workspace.grill.Parent ~ nil
end
script.Parent.Touched:connect(uponTouched) |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
wrong.
function uponTouched(hit)
game.Workspace.grill.Parent = nil
wait(10)
game.Workspace.grill.Parent = game.Workspace
end
script.Parent.Touched:connect(uponTouched) |
|
|
Ok, none work X.x
Whoever makes a working one first gets 50 tix. |
|
jtm110972Join Date: 2007-07-29 Post Count: 5097 |
clone = game.Workspace.grill:Clone()
function OnTouched(hit)
game.Workspace.grill:Remove()
wait(10)
clone.Parent = Workspace
end
script.Parent.Touched:connect(OnTouched) |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
My question:
What is being touched? Is the script inside a certain brick, or just the workspace? |
|
jtm110972Join Date: 2007-07-29 Post Count: 5097 |
INSIDE the brick that's gonna be touched. |
|
DingDong272Top 100 PosterJoin Date: 2007-12-08 Post Count: 9860 |
*question directed at doughnutEater* |
|
|
|
Ok, nobody's worked, and I have a new idea that would make the game more of a challenge anyway ;)
PM me if you do get a TESTED one, to work though. |
|
|
If you put it in the workspace:
model = game.Workspace.grill --Change Model to whatever you named your model
backup = model:clone()
while true do
wait(10)
model:remove()
wait(10)
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
end
If you put it in the model with a submodel called "grill":
model = script.Parent.grill --Change Model to whatever you named your model
backup = model:clone()
while true do
wait(10)
model:remove()
wait(10)
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
end
Now was that so hard??? I must check the competence of everyone: what is 1 + 1?
|
|
|
1 change, the second one should be this
model = script.Parent.grill --Change Model to whatever you named your model
backup = model:clone()
while true do
wait(10)
model:remove()
wait(10)
model = backup:clone()
model.Parent = script.Parent
model:makeJoints()
end |
|