Hi everyone I’m currently working on an InventorySystem and rn I want that if I press on the Delete Button a frame opens idk ima show what I mean
So I want that if I press on the DeleteButton the SureFrame opens IK its pretty ez but idk how to do this I only know the one with script.Parent… I got a script here which is located in the DeleteButton
local button = script.Parent
local frame = game.StarterGui.InventoryGui.InventoryFrame.EquipFrame.SureFrame
button.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
end)
StarterGui is NOT where you’re supposed to change the visibility, you’re changing that from where GUI is cloned over to PlayerGui each spawns according to ResetOnSpawn boolean.
what you should do is get it from one variable
--if the script is parented to ScreenGui
local GUI = script.Parent
local sure_butonz = GUI.InventoryFrame.EquipFrame.SureFrame
OR find it from PlayerGui
local playerSV = game:GetService("Players")
local client = playerSV.LocalPlayer
local GUI = client.PlayerGui.InventoryGui
local sure_butonz = GUI.InventoryFrame.EquipFrame.SureFrame
incase you’re still clueless
local button = script.Parent
local playerSV = game:GetService("Players")
local client = playerSV.LocalPlayer
local GUI = client.PlayerGui.InventoryGui
local sure_fram = GUI.InventoryFrame.EquipFrame.SureFrame
button.Activated:Connect(function() --i prefer this over MouseButton1Click
sure_fram.Visible = false
end)
why are you explaining this to me like i’m a monkey? i’m not this stupid if i’m capable of helping someone on a thread then I think I know what that does, plus it does matter in this case, because he very ovbiously wants to open a confirmation menu before u delete something so setting Visible to true would be better because it would take less time and effort to write and because I assume there’s already a cancel button to set it to false also if it was a confirmation menu then it would completely block the delete button so theres no point in doing not frame.Visible.
Make up your mind already why are there like 3 different types of casing for your variables. GUI is full caps, some of ur variables are snake_case and some of your variables are camelCase. just make them all one type of casing so your code looks more readable.
i mean i dont actually prefer to stylize it based on luau general naming guide, i only do this when i collab on makin games with someone, this isn’t that necessary to do here even someone on devforum doesn’t format it right zzzzzzz
But you are helping a beginner so you should stick to one type of casing so you don’t confuse them + why would you willingly sabotage your ability to read your own code by having 7 different types of casing at once?