Hi i want to create a vip using ulx
but if i create a script with one i want to give him some more healt and speed i get this error :
[ERROR] lua/viptest.lua:2: attempt to call method 'IsUserGroup' (a nil value)
1. fn - lua/viptest.lua:2
2. unknown - addons/ulib_557962238/lua/ulib/shared/hook.lua:110
3. Spawn - [C]:-1
4. unknown - gamemodes/base/gamemode/player.lua:115
my script at that moment look :
local function spawn( ply )
if ( Player( 2 ):IsUserGroup( "VIP" ) ) then
SetPlayerSpeed( ply , 300, 80 )
end
end
hook.Add( "PlayerSpawn", "some_unique_name", spawn )
can someone tell me whats wrong ?