So I’m trying to make a script for a shop but it keeps saying MainFrame is not a valid member of LocalScript “Players.Tunnells.PlayerGui.Shop” - Client
How would I fix it?
local PlayerGui = Player:WaitForChild("PlayerGui")
local Sounds = PlayerGui.Sounds
local Shop = PlayerGui:WaitForChild("Shop")
local BearTrapStuff = PlayerGui.Shop.MainFrame.ItemInfo.BearTrapInfo
debounce = true
PlayerGui.Shop.MainFrame.BearTrap.MouseButton1Click:Connect(function()
BearTrapStuff.Buy.Visible = true
BearTrapStuff.BearTrapImage.Visible = true
BearTrapStuff.BearTrapInfo.Visible = true
BearTrapStuff.BearTrapPrice.Visible = true
end)
BearTrapStuff.Buy.MouseButton1Click:Connect(function()
if Player.leaderstats.Points.Value < 500 and debounce == true and Player.Backpack:FindFirstChild("BearTrap") == nil and Player.Character:FindFirstChild("BearTrap") == nil then
debounce = false
game.StarterGui.Sounds.WiseChose:Play()
game.ReplicatedStorage.RemotesShop.BearTrap:FireServer(Player)
wait(3)
debounce = true
end
end)