I’m trying to make a advanced dialog with gui’s and activating it, with a proximity prompt. If I however press the goodbye dialog choice, it should actually disable the screengui, but it doesn’t. So here is my question: Can you disable a screengui while a remove event is onclientevent? If yes/no, then what should I improve/how should the script be?
It should be able to, could we see the script if possible?
Yes, here it is
Proximity Prompt script
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
game.ReplicatedStorage.EventDialogStart:FireClient(player) --EventDialogStart is the name of the remote event
end)
Closing the GUI
script.Parent.MouseButton1Click: Connect (function()
game.StarterGui.ScreenGui.Enabled = false
Oof, the reason why it isn’t working is cause you’re changing the StarterGui
instead of the PlayerGui
, plus you didn’t even connect the ClientEvent from the local standpoint so change this:
script.Parent.MouseButton1Click: Connect (function()
game.StarterGui.ScreenGui.Enabled = false
To this:
local Player = game.Players.LocalPlayer
game.ReplicatedStorage.EventDialogStart.OnClientEvent:Connect(function()
Player.PlayerGui.ScreenGui.Enabled = false
end)
Alright, thanks for the help! I think I’ll use it
One (final) question, where does this script go to? Because I think I messed up.
Edit: It doesn’t work, so I guess I need more help…?
That line of codes should go in the LocalScript? If you put it in the server script it won’t work that way
I want to see whats firing the Client tho.
Oh thank you I didnt see it before!
Yes I know, but where does the local script go to? Like does it go to StarterGui?
Ah, alright then Ill explain it:
LocalScripts will only work if they’re parented (Or I guess a descendant) of:
- StarterPack
- StarterGui
- Starter Player/CharacterScripts
- ReplicatedFirst
You can put it in StarterGui really if that’s the best choice
Is that the OnClientEvent script or the mousebutton event?
The OnClientEvent function- What were you doing with the MouseClick function?
The mousebuttonclick should be a goodbye dialog for the gui
Just replace the MouseButtonClick
function with that OnClientEvent
function & it should work