Thank you for those who are taking the time to read and think of the answer to this complicated problem (complicated for me).
I have this model, and it contains Integer Values and GUI's with scripts. One of the scripts in the model, clones the GUI (and its scripts) into the Player GUI section (Players > [PLAYER 1] > PlayerGUI > [GUI cloned from the model]).
I am asking, How can I script the GUI so that while its in the Player GUI, it can edit the Integer Values in the model [Workspace > Model].
Side notes: The model is not in the game at start, I use kohl's admin to insert it into the game. Once you sit in the seat with the GUI, it will clone itself into the Player GUI. The model and Integer Values are still in the Work Space section. If you get out of the seat, The GUI gets removed. All this part is all ready scripted and working. I just need to know how I can make the GUI scripts in the Player GUI section edit something in the Work Space.
Again, Thanks for helping me out.
Theres 2 ways to do this. One is for FE; other isnt.
Non-FE Method Make sure the script thats going to change the IntValues is a LocalScript. From there on, just use a simple code like
IntValue.Value = 3
FE Method This involves RemoteFunctions or RemoteEvents, whichever you prefer while I prefer Events ;). Get an event in your Workspace, and when its fired from clientside it uses 2 arguments: the specified IntValue and the new Value. Then, to change the IntValue, put something like this in the Event Script.
player = p //Argument 0 (default) value = iv //Argument 1, the specified IntValue to change. num = nm // Argument 2, the value. iv.Value = nm
Hope this helps, comment for any questions.