Hi I'm not very good at lua I'm pretty new to it.
I need to check the sv.db file to check if the user has a custom tag enabled, and if they do, include it in the chat box. I'm wondering what the best way to check the equality of retrieving pdata is. player_CustomTag is a String value.
if self:GetPData("player_CustomTag") == nil then
Will this work? Or is there a better way of going about this.
Figured it out haha.
For anyone with the same question, the GetPData method has 2 arguments, GetPData(key, any). The key argument is where in the server database file (sv.db) you want to retrieve the data from. The any argument is what you would like to return if the method can't find the data you're looking for.
Example of checking equality:
local money = ply:GetPData("player_name", nil)
if playername then
--found player_name data!
else
--couldn't find player_name data ):
end
Sorry, you need to Log In to post a reply to this thread.