Here's the script that's causing the problem.
local rep = game:GetService("ReplicatedStorage")
local playerBobux = game.Players.LocalPlayer.leaderstats.BOBUX.Value
script.Parent.MouseButton1Click:Connect(function()
local glock = rep.G17
if playerBobux > 49.99 then
local glockclone = glock:Clone()
glockclone.Parent = game.Players.LocalPlayer.Backpack
playerBobux = playerBobux - 50
end
end)
Its a script in a button however when I click the button my BOBUX doesn't change or getting the gun, also the output doesn't have any errors. So, unfortunately, I cannot show an error. Can someone please help me with this problem?

1 comment
Thanks a bunch!