How would i go about making a gui visible with proximity prompt?
2 Likes
1 Like
ProximityPrompt.Triggered:Connect(function(player)
local UI = player.PlayerGui ... -- Location of UI
UI.Visible = true
end)
1 Like
does not work for some reason
oof
1 Like
Could you please reply with the current code you have?
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local player = game.Players.LocalPlayer
local pg = player.PlayerGui
local gui = pg.Start.Frame
gui.Visible = true
end)
in a local script btw bruhhhhhhhhhhh
you don’t need local player as you already have it stated in the connect(function()
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local pg = player:WaitForChild("PlayerGui")
local gui = pg:WaitForChild("Start").Frame
gui.Visible = true
end)
still does not work??!?!?!?!
(30 moment
Did you get any errors? If so tell me
none
(30 chakedfjergergierfqp)
Put this code in workspace.
Use a normal script, not a local script.
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local UI = player.PlayerGui.Start.Frame
UI.Visible = true
end)
2 Likes
Server:
local prompt = script.Parent
prompt.Triggered:Connect(function(player)
game.ReplicatedStorage.setGuiVisible:FireClient(player, true) -- set "true" to whatever you want to make it toggle.
end)
Client:
local Frame = script.Parent
game.ReplicatedStorage:WaitForChild("setGuiVisible").OnClientEvent:Connect(function(setTo)
Frame.Visible = setTo
end)
Video of it in action:
2 Likes
I had the same problem and this helped me a lot. Thanks
3 Likes