I’ve been trying to fix this problem for almost 3 days straight and cant figure out I can fix it…
I’m a developer who started coding recently, and Im trying to make a pet simulator-like game but just with different characters. Right now I am trying to make the door which you buy to get to the next world, but i am having trouble with the pop up gui that says “Buy this place” I already made the gui for it and trying to make the code for it but the gui wont pop up when i press the proximity prompt on the door
this is the video of me showing the code i used to make the proximity promp make the gui pop up, please tell me if it doesnt work
(im really sorry if this is in the wrong topic)
Hello, ‘button’ can mean different things in different contexts. It could be a ProximityPrompt, a simple TextButton, or a response to touch. It all depends on how you want to implement user interaction in your project.
I apologize, I might have misunderstood a bit. If the button is created using ProximityPrompt, you can add a server script to it that will send a signal via RemoteEvent to open the GUI for purchasing a location. Alternatively, you can completely bind the button using a local script (which is more complex for beginners). If you choose to use a server script, it would look something like this:
Add the RemoteEvent to ReplicatedStorage with your specified name.
In short, add this script to the ProximityPrompt:
local Event = game.ReplicatedStorage:WaitForChild("EventName")
script.Parent.Triggered:Connect(function(Player)
Event:FireClient(Player)
end)
Afterward, add a local script to the existing Frame on ScreenGui:
local Frame = script.Parent
local Event = game.ReplicatedStorage:WaitForChild("EventName")
Event.OnClientEvent:Connect(function()
if Frame.Visible == false then
Frame.Visible = true
end
end)
I’m sorry for the confusion, but this is the simplest way to explain it, without unnecessary additional properties.
I tried it and filled in the parts of the code which were supposed to be filled in with your own, it didn’t quite work but it only made the proximity prompt button able to be a single mouse click but the screen gui still does not show up, sorry :c thank you for your help though, I really do appreciate it
Honestly, I could easily help you, but I just don’t fully understand what you want and how you’re doing it right now. If you could provide a copy, I could demonstrate it in three different ways, and then you could decide which one works best
You should use remote events or you can do what I did to fix this. This also happened to me, so I put the gui in the model and changed the script after I triggered the proximity prompt or something like that to:
RejoinGui.Parent = PlayerGui
I did StarterGui before, but It didn’t work that well.
In short, I have created two options: one for touching a part and another for clicking a button. I have also made some improvements to the frame functionality Ninja Chronicles ServSC + Local.rbxl (351.9 KB)