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

How do I fix this error when I try to change a local player value in server script?

Asked by 3 years ago

:16: attempt to index nil with 'IsVotedQ'

game.ReplicatedStorage.UNanyvotesleftQ.OnServerEvent:Connect(function()
    --for _,v in pairs(game.Players:GetChildren()) do
    --  v.IsVotedQ.VotesLeft.Value = v.IsVotedQ.VotesLeft.Value - 1
    --end
    game.Players.LocalPlayer.IsVotedQ.VotesLeft.Value = game.Players.LocalPlayer.IsVotedQ.VotesLeft.Value - 1

end)
0
LocalPlayer can't be accessed from the server. The client (player) that fired the event is included in the parameters. game.ReplicatedStorage.UNanyvotesleftQ.OnServerEvent:Connect(funciton(player) appxritixn 2235 — 3y
0
can you please explain what I need to do in order to get it working? im not much of a scripture Shadrocks12345 0 — 3y

Answer this question