Hello! as my profile says I’m more of an artist than anything. I’m trying to teach myself Lua but it’s not going too well, most of my code has been from here or frankensteined together shoddily, but luckily I can finally post here which means I can finally ask for help! I’m developing hangout space-type games, like those weirdcore ones you see, I’m trying to make a ui for a note appear on a Proximity Prompt and a Remote event which I got from a different tutorial, and then disappear when you hit the closing button (which I got from a tutorial and then modified). The code I pasted and re-worked is working fine- until I try to do it more than once, code is below, and a video of my problem will be attached as well.
Code on the part itself (normal Script):
> local RemoteEvent = game.ReplicatedStorage:WaitForChild(“open note1”) --Variable for Remote Event
local prox = script.Parent.ProximityPrompt --Variable for Proximity Prompt
prox.Triggered:Connect(function(player) --Code runs when the Player triggers the Proximity Prompt
RemoteEvent:FireClient(player) --Fires the Remote Event
end)
Code on the text gui (Local Script):
local RemoteEvent = game.ReplicatedStorage:WaitForChild(“open note1”) --Variable for the Remote Event in Replicated Storage
RemoteEvent.OnClientEvent:Connect(function() --Code runs when the Remote Event is fired
script.Parent.Frame.Visible = true --Makes the frame visible
end)
Code on the image button (Local Script):
local Button = script.Parent
local GUI = Button.ParentButton.MouseButton1Down:Connect(function()
if GUI.Visible == true then
GUI.Visible = falseend
end)
Video:
robloxapp-20240514-1523164.wmv (1.7 MB)
Apologies if I take a while, I am a total newbie at coding, and still don’t understand most of this, Playing on a test map available from my profile, I generally test everything I make there even if the games I’m making don’t add up. I’ve tried searching other threads to find what I’m looking for but none has helped so far, if you need any screenshots or anything let me know! thank you for potential help.