|
I have this script which isn't working (Yes another one *facepalm*)
Basically, It replaces the decal on the stop sign (Decal 2), then after 20 seconds, replaces it with the old one again (But removes Decal 2)
function onClicked()
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
wait(20)
script.Parent.Parent.Stop.Decal.Texture:Remove()
then script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I got these outputs
Sat Oct 30 13:05:38 2010 - Workspace.Model.Down.Script:6: unexpected symbol near 'then'
Sat Oct 30 13:05:38 2010 - Running Script 'Script'
Sat Oct 30 13:05:38 2010 - Workspace.Model.Down.Script:6: unexpected symbol near 'then'
Help appreciated,
MasterDaniel |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
function onClicked()
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
wait(20)
script.Parent.Parent.Stop.Decal.Texture:Remove()
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
Well, it changes the decal now, but dosen't change it back. I don't think removing it before the new one comes up, because the decal won't replace it (Because it can't replace it, because it wouldn't know what face to replace)
Also
would this work?
function onClicked()
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
if script.Parent.Parent.Parent.VehicleSeat.Throttle = 0
then
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
MasterDaniel |
|
|
More like this:
function onClicked()
if script.Parent.Parent.Parent.VehicleSeat.Throttle = 1
then
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
else
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
Wait, you don't even need the function with what I did there:
if script.Parent.Parent.Parent.VehicleSeat.Throttle = 1
then
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
else
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
Ish automatic :D |
|
|
But I want it so you click the button, and the sign changes to "stopping" and when the throttle reaches 0, it replaces it with a dimmer decal. |
|
|
function onClicked()
if script.Parent.Parent.Parent.VehicleSeat.Throttle = 1
then
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
else
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
Still dosen't work
Incase theres any confusion.
Theres a button, that you press and it lights up (Higher Brightness) Decal.
If the bus stops (Throttle = 0) then the decal changes back to the decal it was at the side. (The dimmer version)
And it can be clicked again etc...
Just like the light up stopping sign on buses. |
|
|
ApocalypsJoin Date: 2009-02-15 Post Count: 816 |
function onClicked()
script.Parent.Parent.Parent.VehicleSeat.Throttle = 0
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37857722"
repeat
wait()
until script.Parent.Parent.Parent.VehicleSeat.Velocity.Magnitude < 1
script.Parent.Parent.Stop.Decal.Texture = "http://www.roblox.com/asset/?id=37858494"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|