this script is a button to confirm a purchase.
however, when i run the code and try it out, it doesn't seem to work. (this is a localscript)
button = script.Parent
local Player = game.Players.LocalPlayer
local Tics = Player:WaitForChild("XPCASHFOLDER").Tics
local acquired = Player:WaitForChild("Brawlers").HitmanAcquired
local Title = script.Parent.Parent.Title
button.MouseButton1Click:Connect(function(clicked)
if clicked and Tics.Value < 999 then
Tics.Value = Tics.Value - 1000
acquired.Value = true
script.Parent.Parent.Visible = false
elseif
clicked and Tics.Value > 999 then
Title.Text = "NOT ENOUGH"
Title.TextColor = BrickColor.new("Bright red")
wait(1)
script.Parent.Parent.Visible = false
Title.Text = "Are you sure you want to buy this?"
Title.TextColor = BrickColor.new("Institutional white")
return
end
end)
