2DWorlds Forums
Problem with link() - 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: Problem with link() (/showthread.php?tid=5352)



Problem with link() - Duck - 06-04-2011

[lua]t = { script.Parent, script.Parent.Parent.Box1, script.Parent.Parent.Box2 }

function ERP()
if game.World.KEYValue.Value > 0 and script.Parent.CharacterCollide ~= false then
game.World.KEYVALUE.Value = game.World.KEYVALUE.Value - 1
t.CharacterCollide = false
end
end

link(t.Collided, ERP)[/lua]

I can't tell if I'm having a brainfart or not, but I get an error on that last line telling me link() needs an event and a function


RE: Problem with link() - Qwertygiy - 06-04-2011

Yup. What you need is

[lua]
for q = 1, #t do
link(t[q].Collided, ERP)
end
[/lua]