Julio 21 Report post Posted July 5, 2018 I'm facing some problem I can not see error in my script so it's something overloaded on cha_timer has anyone had this problem? lua expand function [lua_isplayer] parameter number or type error! Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted July 5, 2018 Hello, @Julio! You can see this function in GameServer.exe source code: inline int lua_IsPlayer(lua_State *L) {T_B BOOL bValid = (lua_gettop (L)==1 && lua_islightuserdata(L, 1)); if(!bValid) { PARAM_ERROR return 0; } CCharacter *pCha = (CCharacter*)lua_touserdata(L, 1); if(pCha->GetPlayer()) { lua_pushnumber(L, 1); } else { lua_pushnumber(L, 0); } return 1; T_E} Lua code: local is_player = IsPlayer(role) if (is_player == 1) then ... else ... end Where role is character descriptor (type is userdata). Check if you pass a valid role to the function. 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Fisal Moha 21 Report post Posted July 5, 2018 4 hours ago, Julio said: I'm facing some problem I can not see error in my script so it's something overloaded on cha_timer has anyone had this problem? lua expand function [lua_isplayer] parameter number or type error! its better if you give the function and what it do(where you collecting the role data from) 1 Quote Share this post Link to post Share on other sites
Julio 21 Report post Posted July 5, 2018 thank you so much @V3ct0r @Fisal Moha Quote Share this post Link to post Share on other sites
Julio 21 Report post Posted July 6, 2018 The error was on the cloak. I modified it. function cloak.getCloakLv(item) local getLv = GetItemAttr(item, 55); if(getLv ~= nil) then return getLv; elseif(IsPlayer(role) == 1) then if getLv > nil then return 0; end if getLv > 0 then return getLv; end return 0; end end for: cloak.getCloakLv = function(item) local getLv = GetItemAttr(item, 55); if(getLv ~= nil) then return getLv; end end Quote Share this post Link to post Share on other sites
Fisal Moha 21 Report post Posted July 6, 2018 2 hours ago, Julio said: The error was on the cloak. I modified it. function cloak.getCloakLv(item) local getLv = GetItemAttr(item, 55); if(getLv ~= nil) then return getLv; elseif(IsPlayer(role) == 1) then if getLv > nil then return 0; end if getLv > 0 then return getLv; end return 0; end end for: cloak.getCloakLv = function(item) local getLv = GetItemAttr(item, 55); if(getLv ~= nil) then return getLv; end end you are calling for player role while the [role] is not defined try to see where the code is called from and add the role to the function it should fix it :)) 1 Quote Share this post Link to post Share on other sites