I am currently working on a shop system and I came accross this issue. Here's my script.
local CoolDown = true
script.Parent.Touched:Connect(function(hit)
if hit.Parent:WaitForChild('Humanoid') then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local PlayerGui = player.PlayerGui
if CoolDown == true then
CoolDown = false
PlayerGui.ShopGui.TextLabel:TweenPosition(UDim2.new(0.5,0,0.5,0),'Out','Sine',.5)
PlayerGui.ShopGui.TextLabel.Text = "Are you sure you want to purchase this item for $"..script.Parent.Price.Value.."?"
wait(2)
CoolDown = true
PlayerGui.ShopGui.TextLabel.Yes.MouseButton1Click:Connect(function()
if player.leaderstats.Yen.Value > 150 then
PlayerGui.ShopGui.TextLabel:TweenPosition(UDim2.new(0.5,0,1.5,0),'In','Sine',.5)
player.leaderstats.Yen.Value = player.leaderstats.Yen.Value - script.Parent.Price.Value
end
end)
PlayerGui.ShopGui.TextLabel.No.MouseButton1Click:Connect(function()
PlayerGui.ShopGui.TextLabel:TweenPosition(UDim2.new(0.5,0,1.5,0),'In','Sine',.5)
end)
end
end
end)
Everything is supposed to work, but it's not. The items are not being purchased. Any help?

2 comments
Errors?
There are none. It's just not showing any errors.