Something is wrong with it, but I can not figure out what is wrong, nor what the Output means, here is the script;
if script.Parent:FindFirstChild("Accept")and game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:FindFirstChild("PlayerGui")and game.Players.LocalPlayer.PlayerGui:FindFirstChild("Cash")and game.Players.LocalPlayer.PlayerGui.Cash:FindFirstChild("Amount")and game.Players.LocalPlayer.PlayerGui.Cash.Amount:FindFirstChild("AmountMoney")and script:FindFirstChild("Needed")then script.Parent.Accept.MouseButton1Click:connect(function() if game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney>=script.Needed then script.Parent.Text="Thank you for choosing Equire's" game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney=game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney-script.Needed wait(2) script.Parent:Destroy() elseif game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney<script.Needed then script.Parent.Text="You do not have enough money to pay for this" wait(5) script.Parent.Text=script.Needed end end)end
The Output says; Players.Player1.PlayerGui.ScreenGui.Charged.Script:3: attempt to compare two userdata values
It assumed they weren't integers. You need parentheses. Also, I recommend adding '.Value' for IntValues.
if script.Parent:FindFirstChild("Accept")and game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:FindFirstChild("PlayerGui")and game.Players.LocalPlayer.PlayerGui:FindFirstChild("Cash")and game.Players.LocalPlayer.PlayerGui.Cash:FindFirstChild("Amount")and game.Players.LocalPlayer.PlayerGui.Cash.Amount:FindFirstChild("AmountMoney")and script:FindFirstChild("Needed")then script.Parent.Accept.MouseButton1Click:connect(function() if (game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney >= script.Needed) then script.Parent.Text = "Thank you for choosing Equire's" game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney = game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney - script.Needed.Value script.Parent:Destroy() elseif (game.Players.LocalPlayer.PlayerGui.Cash.Amount.AmountMoney < script.Needed) then script.Parent.Text = "You do not have enough money to pay for this" wait(5) script.Parent.Text = script.Needed.Value end end)end