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
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:04pm
2
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.
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:09pm
4
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.
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:11pm
6
Proxy.MaxActivationDistance = 4
u surely need this
It still doesn’t work. Did I do it right?
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:16pm
8
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.
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:19pm
10
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…
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:24pm
12
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?
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:29pm
14
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.
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:33pm
16
delete the local proxy = Instance.new
and put it as local proxy = ---- your proximityPromt you just put
caviarbro
(caviarbro)
February 28, 2021, 3:33pm
17
StarterGui that makes no sense?
Because whats replicated to player is PlayerGui.
1 Like
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:34pm
18
oh yea my big mistake i was blind
caviarbro
(caviarbro)
February 28, 2021, 3:34pm
19
And also I dont suggest to enable/disable gui by server.
What he did in original post was fine.
MrchipsMa
(MrchipsMan)
February 28, 2021, 3:36pm
20
its not disabled/enable by server or remote event its use like that