What solutions have you tried so far? I tried google searching but nothing work
Server
game.ReplicatedStorage.Citation.OnServerEvent:Connect(function(plr)
local plrgui = plr.PlayerGui
local cash = plrgui:WaitForChild("Info"):WaitForChild("Background").money.Cash
local fineamount = script.Parent.Parent:WaitForChild("Fine")
cash.Value = cash.Value - fineamount.Value
end)
Client
script.Parent.MouseButton1Click:Connect(function()
local plrgui = script.Parent.Parent.Parent.Parent
if plrgui then
game.ReplicatedStorage:WaitForChild("Citation"):FireServer()
script.Parent.Parent.Parent:Destroy()
end
end)```
The issue here is your probably grabbing the value name rather then the value’s value if that makes sense.
Here’s how I would do it.
game.ReplicatedStorage.Citation.OnServerEvent:Connect(function(plr)
local plrgui = plr:WaitForChild("PlayerGui")
local cash = plrgui:WaitForChild("Info"):WaitForChild("Background").money.Cash
local fineamount = script.Parent.Parent:WaitForChild("Fine")
cash.Value = cash.Value - fineamount.Value.Value -- Is fineamount a texlabel, or a value?
print(cash.Value)
end)