So, I’m working on a game I made, and I want to make a part if I press “E” it will bring out the GUI (ProximityPrompt)
And I typed some code in the part I want to add ProximityPrompt to, and I run the game, well there is no error at all in the output but the code doesn’t work, but strangely in the GUI Properties it is detected that the frame is visible
This is my code, looks simple, but please if there is an error please correct it
local SG = game:GetService("StarterGui")
local AP1 = SG.GameGUI.Appreciation1
script.Parent.Triggered:Connect(function()
AP1.Visible = true
end)
local Player = game.Players.LocalPlayer
local AP1 = Player.PlayerGui:WaitForChild("GameGUI").Appreciation1
script.Parent.Triggered:Connect(function()
AP1.Visible = true
end)
make sure the script is a server script. And then do the following :
script.Parent.Triggered:Connect(function(Player)
local UI = Player.PlayerGui:WaitForChild("GameGUI")
if UI then
UI.Enabled = true
--if you want to make a frame/button visible, then access to that button/frame
UI["BUTTON/FRAME'S NAME"].Visible = true
end
end)