Help with fixing my scripts that make a proximity point open a gui

Hi,

I am working on making a block open a gui. I used a tutorial but I think theres something wrong with the scripts.

Locations

So I have a gui with a frame in it in the starter gui. In the frame I have a local script. I will write down what the local script says. I also have a remote event inside of replicated storage. I also have a part with a script in it.

Issue

The script sets up a proximity point. When you hold E for about one second it opens a gui. But when I hold E it doesn’t open a gui. Then a few minutes later(I took I break) I tried it again and there was no proximity point.

scripts

Script(Local)

local Frame = script.Parent

game.ReplicatedStroage.RemoteEvent.OnClientEvent:Connect(function() Frame.Visble = not Frame.Visble end)

Script(Script)

local Event = game.ReplicatedStorage.RemoteEvent local Proxy = Instance.new("ProximityPrompt",script.Parent) Proxy.HoldDuration = 1 Proxy.ActionText = "Read Text" Proxy.ObjectText = "Grave" Proxy.KeyboardKeyCode = Enum.KeyCode.E Proxy.GamepadKeyCode = Enum.Keycode.ButtonA Proxy.ClickablePrompt = true Proxy.enabled = true Proxy.Triggred:Connect(function(plr) Event:FireClient(plr) end)

I hope you guys can help.

From,
Mista

instead of needing to fire client do it like this:

Proxy.Triggred:Connect(function(plr)

plr.StarterGui.yourGui.Enabled = not plr.StarterGui.yourGui.Enabled    ---replace "yourGui" by the gui you want 

end)

Hi,

My thing still doesn’t work. Its not showing the proximity point. I don’t know why.

did u set the proximityPromt distance

Um. There is no proximity point. Its created in the script. I don’t know how to set the distance.

Proxy.MaxActivationDistance = 4
u surely need this

It still doesn’t work. Did I do it right?

oh i see the mistake u wrote triggered wrong in Proxy.Triggerd:Connect(function etc..... u mispelled it as triggred

Ok I fixed the error but it still doesn’t work.

maybe try to actually put a prompt in the parent of script no need to create it via script

Hi,

I don’t really understand…

like actually put a Proximity prompt instead of just creating one from a script

Oh. So I delete the script and put a probity point inside but keep the local?

just remove the line where it creates the proximity prompt and for the Triggered function you will have to make it yourself

Ok I did it. It still doesn’t work. I added a proximity point and I deleted the proxy lines.

delete the local proxy = Instance.new

and put it as local proxy = ---- your proximityPromt you just put

StarterGui that makes no sense?
Because whats replicated to player is PlayerGui.

1 Like

oh yea my big mistake i was blind

And also I dont suggest to enable/disable gui by server.
What he did in original post was fine.

its not disabled/enable by server or remote event its use like that