How to make a proximity prompt open a gui

What do i want to achieve
I want to make a proximity prompt to open a gui
What have I tried

--Script in ServerScriptService
local edit = game.Workspace.ScriptingStand.StandMesh.Edit
local RS = game:GetService('ReplicatedStorage')
local guiopener = RS:WaitForChild('GuiOpener')
local function fireclient(player)
	guiopener:FireClient(player)
end


--local Script in StarterPlayerScripts
local RS = game:GetService('ReplicatedStorage')
local GuiOpener = RS:WaitForChild('GuiOpener')
local Players = game:GetService('Players')
local player = Players.LocalPlayer
local ScreenGui = player.PlayerGui:WaitForChild('TextScreenGui')
local lighting = game:GetService('Lighting')
local edit = workspace.ScriptingStand.StandMesh.Edit

GuiOpener.OnClientEvent:Connect(function(player)
	edit.Triggered:Connect(function()
		ScreenGui.Enabled = true
	end)
end)
1 Like

you can use this

local ProximityPrompt = ProximityPromptLocation

ProximityPrompt.Triggered:Connect(function(player)
	player.PlayerGui.TextScreenGui.Enabled = true
end)

with one script anywhere without using remotes

Ive aleardy done this but it only works once i dont know why

1 Like