Im trying to make this negate 25 money, it just sets the current money to -25

It just sets the money value to 25 idk whats wrong with it.

local remoteEvent = script.Parent:FindFirstChild("Bought")
local player = game.Players.LocalPlayer
local money = player:WaitForChild("leaderstats"):WaitForChild("Money")


remoteEvent.OnClientEvent:Connect(function()
    print("Event Fired")
    money.Value = -25
end)
2 Likes
local remoteEvent = script.Parent:FindFirstChild("Bought")
local player = game.Players.LocalPlayer
local money = player:WaitForChild("leaderstats"):WaitForChild("Money")


remoteEvent.OnClientEvent:Connect(function()
    print("Event Fired")
    money.Value -= 25
end)
2 Likes

yeah i did this too it just said that, it also just doesnt work in roblox studio
image

2 Likes

It’s because you’re setting the value to -25.
It should be either

money.Value -= 25
--I prefer this

or

money.Value = money.Value - 25
3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.