• PData working correctly on client, but server refuses to fetch it.
    4 replies, posted
[Lua] PData Problem That's my code in a pastebin if you need to look at it (and yes, I know it's inefficient and sloppy) The problem is, I can save my level on the client correctly no questions asked, but the server always defaults it to 1. I suck at PData, so it's probably something small. I don't know if it's how I'm getting the info, or if it's the fact that it's in a for loop, but for the life of me I cannot get the server to fetch the players "ClearanceLevel" Pdata correctly. Thanks for checking this out, I greatly appreciate you taking time out of your day to help with my retardedness.
PData.... If you run it on CLIENT, it doesn't leave CLIENT. If you run it on SERVER, it doesn't leave SERVER. Firstly, why are you collecting DATA on the client, it can be forged through the power of haxermen. Collect DATA on the server, save the PDATA on the server, then send it to the CLIENT through either net.Start or Search results for "NW" For example: -- SERVER hook.Add( "PlayerSpawn", "clearancelevel", function( ply ) ply:SetPData( "ClearanceLevel", 1 ) ply:SetNWInt( "ClearanceLevel", ply:GetPData( "ClearanceLevel", 1 ) ) end ) -- CLIENT blalblalblalbllalblalblal client stuff LocalPlayer():GetNWInt( "ClearanceLevel", 1 ) Also, unless you are using this for a HUD, Menu, or chat.AddText, I see no use of having the Clearance Level on the client? If you want to broadcast it just use PLAYER:Say( "" ). The way that was shown isn't that efficient, but it works. (try redoing it and making your own.)
So, It's a problem with my save function. Kindof what i was expecting. So if this is the case, how would I save a player's pdata to the server? I don't need the client for what I'm trying to do anyway.
I updated what I said.
yeah lol you caught me off guard with it XD
Sorry, you need to Log In to post a reply to this thread.