I'm trying to make a gui where it states the leaderboard stat on the gui, (like CASH: (leaderstats.Cash.Value here)) but this thing keeps popping up, "attempt to index local 'MV' (a number value).
Here are both of my scripts if necessary:
--SERVER SCRIPT-- function cV (player,cashAmount) print("This function has been invoked by "..player.Name.."CASH: "..cashAmount.Value) return cashAmount.Value end game.ReplicatedStorage:WaitForChild("RemoteFunctions").Change.OnServerInvoke = cV
--LOCAL SCRIPT-- local RS = game:GetService("ReplicatedStorage") local remotef = RS.RemoteFunctions:WaitForChild("Change") while true do wait(.1) local MV = remotef:InvokeServer(game.Players.LocalPlayer.leaderstats.Cash) script.Parent.Text = "[$] CASH: "..MV.Value -- THE PROBLEM/ERROR end
You already returned the Value of MV in your RemoteFunction, Just concatenate the number value
script.Parent.Text = "[$] CASH: "..MV