Hello, I’m scripting a nuclear control room and am fairly new to scripting. I’m trying to animate control rods inserting on a monitor when the control rod throttle is in a certain position. However, I’m unsure of how to call the function which makes the next level of inserted control rods (on the monitor) appear when the click detector for the control rod throttle is clicked. Essentially, I’m not sure how to call a separate function when a separate click detector is activated. I know this seems vague, but could I get a bit of guidance?
There’s a MouseClick event for a click detector that fires whenever the click detector is clicked. You can use Connect to connect the function to that event and make it run whenever that event fires.
Example:
function onclick()
print( "The click detector was clicked!" )
end
Yourclickdetector.MouseClick:Connect(onclick())