Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Other players cant see when player loses ingame money how can I fix that?

I am trying to take money away from player when they press a button but when I do it in local script it only takes the money away from them and others cant see that his/her money is gone and I can't turn it into normal script cuz stuff goes wrong can someone tell me what to do?

local player = game.Players.LocalPlayer local UserInputService = game:GetService("UserInputService")

script.Parent.MouseButton1Click:Connect(function(Clicked) if player.leaderstats.Coins.Value >= 5 then player.leaderstats.Coins.Value = player.leaderstats.Coins.Value -5

	script.Parent.Parent.TextLabel3.Visible = true
	script.Parent.Parent.TextButton.Visible = false
	script.Parent.Parent.TextButton13.Visible = true 

(as I said I cant turn this script into normal script cuz of the stuff that is written below)

1 answer

The answer is simple: You're doing this on the client.

Most changes made on the client do not replicate to the server, therefore the server will not see these changes and will use its values instead of the client's. You'll need to deduct coins on the server, preferably using a RemoteEvent or RemoteFunction to do this.

1 comment

0

thnks

This discussion is preserved as it was. New answers, comments, and votes are closed.