Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
10/14/10 #2 - Events
#1
Events are now working (currently only Collided). This is how you use them:

Code:
link(script.Parent.Collided, function(h) h.Color = Color(math.random(0, 255), math.random(0, 255), math.random(0, 255)) end)

This will make the part the script is in a color changer.

When a script is removed, any events created from it are deactivated.

I will work on tools tomorrow.
Reply
#2
can you give atleast a small example on a oncollided script?

because the one that you have is a slight bit confusing
Reply
#3
Use link(object.event, function) to connect an object's event to a function. The function should take 1 argument, which will be the other part it collided with.

Code:
link(script.Parent.Collided, function(h)
print(script.Parent.Name.." collided with "..h.Name)
end)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)