game.ReplicatedStorage.RemoteEvents.ChangeStatRemote.OnServerEvent:Connect(function(plr, stat, val)
if plr.Name == "my username" then
plr.Stats[stat] = val
else
plr:Kick("No u")
end
end)
-- ^ server script
game.ReplicatedStorage.RemoteEvents.ChangeStatRemote:FireServer('Level',500)
-- ^ local script
Level is not a valid member of Folder
-- ^ Error
COMMUNITY QUESTION
What am I doing wrong with this stat changing remote im trying to call?
1 answer
game.ReplicatedStorage.RemoteEvents.ChangeStatRemote.OnServerEvent:Connect(function(plr, stat, val)
if plr.Name == "Elixcore" then -- Added your username
plr.Stats[stat].Value = val -- Added .Value
else
plr:Kick("No u")
end
end)
-- ^ server script
game.ReplicatedStorage.RemoteEvents.ChangeStatRemote:FireServer('Level',500)
-- ^ local script
Level is not a valid member of Folder -- Maybe the level value does not exist or is lowercase?
-- ^ Error
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
the [stat].Value fixed everything!
I am happy I helped you! :D