I have a script which contains a function to regen a model - script is inside the model in the workspace. I need this function to run when a button in a PlayerGUI is pressed, but not sure how to go about this. I have tried just referencing the button from the main script, but that didn’t seem to work, and due to the setup I am unable to put this regen code inside the GUI button. Does anybody have any ideas of how to go about getting this function to run when the GUI button is clicked?
How would I set this up, I assume a local script inside the button but what lines of code would need to be in there, and what would need to be added to the main script to run the function when button pressed?