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

Attempt to index local 'MV' (a number value)?

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

1 answer

✓ Accepted answer

You already returned the Value of MV in your RemoteFunction, Just concatenate the number value

script.Parent.Text = "[$] CASH: "..MV

1 comment

0

Ohh, I see now, thx :).

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