Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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

Log in to vote
1
Answered by
aazkao 787 Moderation Voter
5 years ago
Edited 5 years ago

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

script.Parent.Text = "[$] CASH: "..MV
0
Ohh, I see now, thx :). InstantManager 27 — 5y
Ad

Answer this question