LUA Problem: Please help me

Hello, so I have this code here

– Be a Zombie by IceGaming, v1
local zombie = {}

function zombie.tick()
playerID = PLAYER.PLAYER_ID()

playerPed = PLAYER.GET_PLAYER_PED(playerID)
   
if get_key_pressed(76) then

playerPed.SET_PLAYER_MODEL(player, GAMEPLAY.GET_HASH_KEY(u_m_y_zombie_01))

end

end
return zombie

and it says :

tick: scripts/addins/zombie.lua:11: attempt to index global ‘playerPed’ (a numbe
r value)​

I read other articles and all of them said something about an object. I really need help so I can further what I would like to make. Please help, and thanks!

Also if you do know where and how to add/change/remove a code line to fix it, please tell me. Thanks!

Which line is line 11?

playerPed.SET_PLAYER_MODEL(player, GAMEPLAY.GET_HASH_KEY(u_m_y_zombie_01))​ is line 11, Thanks for responding! :smiley:

playerPed is apparently set to a number value with ‘playerPed = PLAYER.GET_PLAYER_PED(playerID)’. 

You then try to access it as if it’s an object or table with ‘playerPed.SET_PLAYER_MODEL…’. 

Would need to see the ‘PLAYER.GET_PLAYER_PED’ function to give a more complete answer.

   

This is for a GTA mod, which is a legal one that will not be used to harm the online game, it will be used to test dev scripts, and just learn more. The copyed code is 

void SET\_PLAYER\_MODEL(Player player, Hash model) // 00A1CADD00108836 774A4C54 

And this is the website I got it from: http://dev-c.com/nativedb/ . I really am hoping to be able to modify the player model to be a zombie on key hit so I can make a zombie mod! :smiley:

Also this code works

-- Max HP by IceGaming, v1 local health = {} function health.tick() playerID = PLAYER.PLAYER\_ID() playerPed = PLAYER.GET\_PLAYER\_PED(playerID) if get\_key\_pressed(75) then ENTITY.SET\_ENTITY\_HEALTH(playerPed, 200) end end return health

PROBLEM SOLVED!

Which line is line 11?

playerPed.SET_PLAYER_MODEL(player, GAMEPLAY.GET_HASH_KEY(u_m_y_zombie_01))​ is line 11, Thanks for responding! :smiley:

playerPed is apparently set to a number value with ‘playerPed = PLAYER.GET_PLAYER_PED(playerID)’. 

You then try to access it as if it’s an object or table with ‘playerPed.SET_PLAYER_MODEL…’. 

Would need to see the ‘PLAYER.GET_PLAYER_PED’ function to give a more complete answer.

   

This is for a GTA mod, which is a legal one that will not be used to harm the online game, it will be used to test dev scripts, and just learn more. The copyed code is 

void SET\_PLAYER\_MODEL(Player player, Hash model) // 00A1CADD00108836 774A4C54 

And this is the website I got it from: http://dev-c.com/nativedb/ . I really am hoping to be able to modify the player model to be a zombie on key hit so I can make a zombie mod! :smiley:

Also this code works

-- Max HP by IceGaming, v1 local health = {} function health.tick() playerID = PLAYER.PLAYER\_ID() playerPed = PLAYER.GET\_PLAYER\_PED(playerID) if get\_key\_pressed(75) then ENTITY.SET\_ENTITY\_HEALTH(playerPed, 200) end end return health

PROBLEM SOLVED!