Could I get some examples of selected & deslected connections?
#1
I just started trying to mess with them a while ago but I can't figure out how to use them for the life of me. Here's what I have:

Code:
link(script.Parent.selected,
cam.FollowObject = car
cam.ScaleFactor = 50
end)

link(script.Parent.deselected,
cam.FollowObject = p.Parent.Body
end)

Yet I keep getting this error: (the portion of code I gave you begins at line 10)

Code:
[2010-10-17 17:43:24] Game.StarterInventory.Car.Drive: [string "Game.StarterInventory.Car.Drive"]:10: ')' expected near `=`

Any help would be greatly appreciated because I'm kind of getting frustrated with this.
LISTEN TO THE ALBUMS I PUT IN MY SIGNATURE
___________________________
[Image: 511873.jpg][Image: 744241_isls_vapours.jpg]
Reply
#2
It should be:
Code:
link(script.Parent.selected,
function()
cam.FollowObject = car
cam.ScaleFactor = 50
end)

or

Code:
function onSelected()
cam.FollowObject = car
cam.ScaleFactor = 50
end
link(script.Parent.selected, onSelected)

The second argument is a function, not just a piece of code.
Reply
#3
Oh wow I'm stupid. ahahaha
Thanks.
LISTEN TO THE ALBUMS I PUT IN MY SIGNATURE
___________________________
[Image: 511873.jpg][Image: 744241_isls_vapours.jpg]
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)