local R=prizeGUI:WaitForChild("\083\112\097\114\107\108\101\114\071\101\110\101\114\105\099")local x=prizeGUI:WaitForChild("\069\120\105\116\066\117\116\116\111\110")local function K()prizeGUI.Visible=false end local function I()prizeGUI.Visible=true end local function t()prizeGUI.Visible=false end local function U(R)local x=sparklerPrize:Clone()x.Parent=backpack local K=player.Character or player.CharacterAdded:Wait()local I=K:FindFirstChild("\072\117\109\097\110\111\105\100")or K:WaitForChild("\072\117\109\097\110\111\105\100")I:EquipTool(x)end x.MouseButton1Click:Connect(K)R.MouseButton1Click:Connect(function()U()end)proximityPrize.Triggered:Connect(I)
-- Buttons
local sparklerButton = prizeGUI:WaitForChild("SparklerGeneric")
local exitButton = prizeGUI:WaitForChild("ExitButton")

local function exit()
	prizeGUI.Visible = false
end

local function openPrizeGUI()
	prizeGUI.Visible = true
end

local function openRedeem()
	prizeGUI.Visible = false
end

local function awardPrize(whichPrize)
	-- Check if backpack already has that sparkler
	local cloneObject = sparklerPrize:Clone()
	cloneObject.Parent = backpack

	-- MAybe equip it?
	local character = player.Character or player.CharacterAdded:Wait()
	local humanoid = character:FindFirstChild("Humanoid") or character:WaitForChild("Humanoid")

	humanoid:EquipTool(cloneObject)
end

exitButton.MouseButton1Click:Connect(exit)

sparklerButton.MouseButton1Click:Connect(function()
	awardPrize()
end)

proximityPrize.Triggered:Connect(openPrizeGUI)
