Hey all!
I am creating a GUI gear shop, and I have run into a problem. When the player goes to purchase the gear, the gear shows up in their inventory, but does not actually function. (sounds don’t play, can’t ‘eat’)
Here is a video showcasing the problem. (sorry for the bad quality it was recorded in studio lol)
The pizza on the ground is the exact same as the one the player purchases.
robloxapp-20230529-1918028.wmv (1.9 MB)
here’s the script to purchase the pizza:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ShopGui = Players.LocalPlayer.PlayerGui.Shop
local ShopFrame = ShopGui.Frame
local PizzaButton = ShopFrame.ScrollingFrame.Pizza
PizzaButton.MouseButton1Click:Connect(function()
local player = Players.LocalPlayer
local cash = player.leaderstats.Doubloons
if cash.Value >= 10 then
if player.Backpack:FindFirstChild("Pizza") == nil and player.Character:FindFirstChild("Pizza") == nil then
cash.Value = cash.Value - 10
local pizza = ReplicatedStorage.Pizza:Clone()
pizza.Parent = player.Backpack
else
print("You already have the Pizza!")
end
else
print("Not enough cash to purchase Pizza!")
end
end)
if anyone has some tips, it would be very helpful ![]()