Katorzzee Posted February 20, 2018 Share Posted February 20, 2018 Bom quero saber como posso corrigir o erro neste script Client : function kills() setElementData ( getLocalPlayer ( ), "kills", 0 ) end addEventHandler ( "onPlayerJoin", root, kills ) Server : function MostrarKills () if ( thePlayer ) then local contarkills = getPlayerKills( getLocalPlayer() ) local contardeaths = getPlayerDeaths( getLocalPlayer() ) outputChatBox ( "O Player"..getPlayerName(player).."Tem"..contarkills.."/"..contardeaths"", root, 255, 255, 255, true ) end end addCommandHandler("kills", MostrarKills) Link to comment
DNL291 Posted February 20, 2018 Share Posted February 20, 2018 onPlayerJoin é um evento do lado server, use o evento "onClientResourceStart" e troque root por resourceRoot. No comando, use os parâmetros: sourcePlayer, commandName, targetPlayerName. function MostrarKills( sourcePlayer, commandName, targetPlayerName ) Verifique se existe um jogador com esse nome, se sim, prossiga a função com getPlayerKills/getPlayerDeaths (que precisam estar no seu código pra ele funcionar) e no lugar de getLocalPlayer() use getPlayerFromName. Um conselho, sempre que criar uma postagem nova, pesquise antes pelo fórum. Já tem vários tópicos relacionados a isso. Link to comment
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