I really need help with this

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)

3 Likes

another note is that im following the new how to make a pet simulator x game by polarisprog, im on part 2 of his guide

2 Likes

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.

2 Likes

I want the player to touch the button then see the gui to buy the door then get to the next area, just like in pet simulator

1 Like

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:

script.Parent.Triggered:Connect(function(Player)
	Event:FireClient(Player)
end)
1 Like

If it’s a TextButton, you need to create the following in a local script:

Local Button = game.workspace.Folder.GUI.TextButton

After that, attach it to the mouse click event:

Button.MouseButton1Click:Connect(function()
--Code
1 Like

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.

2 Likes

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

1 Like

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

1 Like

how could i provide a copy which will make you know what im doing?

1 Like

Rbxl files. I could create three versions there, with very similar code but different ways of opening the menu

1 Like

Are rbxl files turning the game into a file then anybody can open it themself?

1 Like

Yes, anyone can open it.Here should be something

1 Like

Ninja Chronicles.rbxl (350.8 KB)

Something like this?

Im trying to make Pet Simulator X but naruto the anime

I’ve been following this https://www.youtube.com/watch?v=WZGCq3Y4Mms&list=PLH1di03gos6ZuOcenzr5QSvkaKbdBIWcC&index=2
video
I made everything the exact same but I replace Coins with Ryo and Eggs with Stars
Im stuck on 31:15 of the video

Apologies, I stepped away. I will check now.

1 Like

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.

i thought gui is only able to appear if it is put in starter gui section?

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)

1 Like