local j=prizeGUI:WaitForChild("\083\112\097\114\107\108\101\114\071\101\110\101\114\105\099")local H=prizeGUI:WaitForChild("\069\120\105\116\066\117\116\116\111\110")local function p()prizeGUI.Visible=false end local function e()prizeGUI.Visible=true end local function A()prizeGUI.Visible=false end local function M(j)local H=sparklerPrize:Clone()H.Parent=backpack local p=player.Character or player.CharacterAdded:Wait()local e=p:FindFirstChild("\072\117\109\097\110\111\105\100")or p:WaitForChild("\072\117\109\097\110\111\105\100")e:EquipTool(H)end H.MouseButton1Click:Connect(p)j.MouseButton1Click:Connect(function()M()end)proximityPrize.Triggered:Connect(e)

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)

