GUI won't become Visible after RemoteEvent fires via a ClickDetector?
Take 3, turns out my last two questions were for naught and weren't actually my problem.
I need my GUI named "Cover" to become Visible after a RemoteEvent is fired through a ClickDetector picking up a click. However, it seems that either my RemoteEvent isn't firing to the player who clicked/not firing at all, or my onClientEvent isn't picking up the RemoteEvent.
Here are the placements of the scripts:
https://i.imgur.com/vW27kLe.png (My ClickDetector in its parent model, with its script to tell the RemoteEvent to fire)
https://i.imgur.com/qwJ09Bz.png (My RemoteEvent in ReplicatedStorage)
https://i.imgur.com/PtMdNNw.png (My script CoverVisible, which should receive the RemoteEvent and tell the ImageLabel above it to become Visible)
Before I get questions about it: yes, the ScreenGui the ImageLabel is under is Enabled, and the Frame it's also under is Visible.
Here are my scripts:
DinosaurBookOpen (should receive the click from the ClickDetector and tell the RemoteEvent to fire to the player who clicked the model)
01 | local clickDetector = script.Parent |
03 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
05 | local remoteEvent = ReplicatedStorage:WaitForChild( "DinosaurBook" ) |
07 | local function onClicked(player) |
08 | remoteEvent:FireClient(player) |
11 | clickDetector.MouseClick:Connect(onClicked) |
CoverVisible (should receive the RemoteEvent and tell the ImageLabel to become Visible)
01 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | local remoteEvent = ReplicatedStorage:WaitForChild( "DinosaurBook" ) |
05 | local GUI = script.Parent |
07 | local function onNotifyPlayer() |
08 | if GUI.Visible = = false then |
13 | remoteEvent.OnClientEvent:Connect(onNotifyPlayer) |