buy=script.Parent wep=game.ServerStorage["AK-47"] price=script.Parent.IntValue.Value buy.MouseButton1Down:connect(function() local user=game.Players.LocalPlayer if user.leaderstats.Caps.Value>=price then user.leaderstats.Caps.Value=user.leaderstats.Caps.Value-price local wepa=wep:Clone() wepa.Parent=user.Backpack end end)
There is a tool in serverstorage named AK-47. The localscript is nested in the text button. There is an IntValue in the TextButton. Caps is an IntValue.
Hope this helps.
If FilteringEnabled is turned on, LocalScripts cannot access ServerStorage. In addition, SurfaceGuis do not run on LocalScripts as they are in the workspace and are seen by everyone in the server, not just a singular player individually. A server script would be used for this and would resolve the ServerStorage and the running issues.
If you run into another problem, please let me know and I will find a solution.