WeeD1 Posted February 10, 2019 Posted February 10, 2019 Alguém por favor poderia me auxiliar no erro desse script? Estou tentando a dias concertar isso e não encontrei nada de errado no código. WARNING: [Mod]KillMsg\client.lua:4: Bad argument @ 'getPlayerName' [Expected player at argument 1, got vehicle] ERROR: [Mod]KillMsg\client.lua:4: attempt to index a boolean value function onClientPlayerWasted(killer) local names = getPlayerName(source):gsub("#%x%x%x%x%x%x", "") if killer then local namek = getPlayerName(killer):gsub("#%x%x%x%x%x%x", "") outputJoinquitMessage("#00ff00"..namek.."#FFFFFF matou #00ff00"..names.."") else outputJoinquitMessage("#00ff00"..names.."#FFFFFF cometeu suicidio") end end addEventHandler("onClientPlayerWasted", root, onClientPlayerWasted)
Other Languages Moderators Lord Henry Posted February 10, 2019 Other Languages Moderators Posted February 10, 2019 Substitua o killer da linha 4 por source. 1
WeeD1 Posted February 10, 2019 Author Posted February 10, 2019 Já tentei usar o source, porém isso é um sistema de kill mensagens, se eu colocar source, se um player matar o outro, irá aparecer que ele próprio se matou, em vez de aparecer que o jogador x matou o jogador y, com o uso de source ficou aparecendo o jogador x matou o jogador x.
Other Languages Moderators Lord Henry Posted February 10, 2019 Other Languages Moderators Posted February 10, 2019 Por isso vc precisa de um verificador antes. if (getElementType (killer) == "player") then 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now