2DWorlds Forums
I need help with this color change script. - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: I need help with this color change script. (/showthread.php?tid=3661)



I need help with this color change script. - awolfers - 04-20-2011

detector = script.Parent
function Bake(hit)
if hit.Name = Bread
and detector.On = true
then hit.Color = 102,51,0
link (block.Collided, Bake)

Nothing happens. Help?
:furious::furious::furious::furious::furious::furious::furious::gun_bandana::gun_bandana::gun_bandana:


RE: I need help with this color change script. - AK-47 - 04-20-2011

detector = script.Parent
function Bake(hit)
if hit.Name == Bread and detector.On == true then
hit.Color = Color(102,51,0)
sleep(.1)
link(detector.Collided, Bake)



Hope this helps!


RE: I need help with this color change script. - Qwertygiy - 04-20-2011

[lua]
detector = script.Parent
function Bake(hit)
if hit.Name == "Bread" and detector.On.Value == true then
--If On is a BoolValue, you need .Value too.
hit.Color = Color(102,51,0)
sleep(.1)
end end --IMPORTANT!
link(detector.Collided, Bake)

[/lua]



RE: I need help with this color change script. - AK-47 - 04-20-2011

(04-20-2011, 01:27 PM)Qwertygiy Wrote: [lua]
detector = script.Parent
function Bake(hit)
if hit.Name == "Bread" and detector.On.Value == true then
--If On is a BoolValue, you need .Value too.
hit.Color = Color(102,51,0)
sleep(.1)
end end --IMPORTANT!
link(detector.Collided, Bake)

[/lua]
detector = script.Parent
detector.On.Value
link(detector.Collided, Bake)

Hmm, how can you hit a bool value???



Thinking about it... mine won't work, too.


RE: I need help with this color change script. - Rare - 04-20-2011

Well... thanks too Big Grin


RE: I need help with this color change script. - Guest - 04-26-2011

detector = script.Parent
function Bake(hit)
if hit.Name == "Bread" and detector.On.Value then
hit.Color = Color(102,51,0)
sleep(.1)
end
end
link(detector.Collided, Bake)
derp