Help with Local client with GUIs

I made a script to show a GUI keypad in a project. the problem is that the GUI doesn’t appear. I noticed tht the gui only appears in the server client. Can anyone help me?

I use this script to show the gui

  local Click = script.Parent:WaitForChild("ClickDetector")
Click.MouseClick:Connect(function(Plyr)
print(132134)
game.StarterGui.Echo12Keypad.Keypad.Visible = true
end)
1 Like

Im confused by what you mean by this, Do you want others to be able to see the gui that pops up?
If so you need to add a remote event, when they click fire the event. Have another script that sees when the remote event was fired and then performs the action (Making the gui visible)

No, I mean, I can’t see the GUI as a player(Client) but It appears when I change to server mode

You need to address the local player in the script. From what i see your addressing the server Gui. You can achieve this by doing

Player.PlayerGui.UI

Player is the local player or the client player (Get that however you want but i think you get it from click.)
The ui is your ui path

Im not good at scripting but i think you need to add a remote event and paste it into a replicated storage (you can put it anywhere you want thats just example) and then when you click it will :FireClient

Heres script:

local event = game.ReplicatedStorage.RemoteEvent -- put the way to event
local Click = script.Parent:WaitForChild("ClickDetector")
Click.MouseClick:Connect(function(Plyr)
print(132134)
event:FireClient()

Heres local script - put it into StarterGui or something

local event = game.ReplicatedStorage.RemoteEvent -- put the way to event
local playergui = game.Players.LocalPlayer.PlayerGui
event.OnClientEvent:Connect(function()
playergui.Echo12Keypad.Keypad.Visible = true
end)

No need for an event. The click function gets the player path and im sure you can open the gui from the script by using that path

1 Like

oh ye maybe something like this?

local Click = script.Parent:WaitForChild("ClickDetector")
Click.MouseClick:Connect(function(Plyr)
print(132134)
Plyr.PlayerGui.Echo12Keypad.Keypad.Visible = true
end)
1 Like

Exactly what i was thinking but was just to lazy to write it in code! Lol

1 Like