I am developing an online school (GE International School)
and now want to open screen GUIs when a student clicks a tablet in the classroon.
Now I have made a ClickDetector and wrote a local script as follows,
only to see nothing is shown when I click the pointer.
I will appreciate if someone point out the cause of the problem.
Code within LocalScripts will only run if it’s a descendant of one of the following objects:
A Player’s Backpack , such as a child of a Tool
A Player’s Character model
A Player’s PlayerGui
A Player’s PlayerScripts .
The ReplicatedFirst service
In the first screenshot you posted, the “OpenExerciseTest” LocalScript is not a descendant of any of those objects, which means that the code won’t run.
Thank you for your quick reply.
I didin’t know above fact.
And so I added the script into another local script in StarterGui (means PlyaerGui)
and found it works now.
(I used Frame.Visible instead of ScreenGui.Enabled)
Thank you again for your useful information.
I am planning to prepare multiple tablets in the classroom
and I believe for loop will work for that.
So far I tried with only one tablet, but later I will test with multiple tablets.
It is in fact better to use a local script for this (as ClickDetector instances will still operate) and the player’s PlayerGui instance should only ever be handled locally on the client-side through the use of local scripts.