A OnCLick Gui that Gives a Player an Item if they have certain things

The issue is that you are using a TextLabel, not a TextButton.

TextLabels don’t have an .MouseButton1Click property.

1 Like

Okay Thanks let me try it to see if it works now!

There is still a problem with the Backpack defining in the Local Script. I think this may be another problem about Local Scripts and not defining it correctly?

local Have = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorageEvent = ReplicatedStorage:WaitForChild("ServerStorageEvent")

local function Check(player)

	local backpack = player:WaitForChild("Backpack")
	local Gem = game.ServerStorage.Gem
	local Gold = game.player.leaderstats.Gold
	local MasterSword = game.ServerStorage.Tools.POSword

	if(backpack:FindFirstChild(Gem.Name)) and Gold.Value >= 100 and Have == false then
		ServerStorageEvent:FireServer(player, Gold, MasterSword)
		Have = true