MKZ Posted April 29, 2022 Share Posted April 29, 2022 eu fiz um sistema de /pro, so que quando o player morre ele continua com o pro, eu ja tentei desativar com o evento "onPlayerWasted" mas nao funciona. function godCommand(player) local conta = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then if getElementData(player,"onProt") then setElementData(player,"onProt",false) setElementModel(player, 0) outputChatBox("O staff "..getPlayerName(player).." esta OFF",root,255,255,0,true) else setElementData(player,"onProt",true) setElementModel(player, 10) outputChatBox("O staff "..getPlayerName(player).." esta ON",root,255,255,0,true) end end end addCommandHandler("pro",godCommand) eu queria colocar o onProt no false quando o player morrer. Link to comment
Pedrow Posted July 22, 2022 Share Posted July 22, 2022 Ea í, @MKZ não sei como você fez, mas para quando o player morrer e quer tirar um elementData dele, utilizamos onPlayerWasted mesmo. Pode fazer desta forma: addEventHandler('onPlayerWasted', root, function() if not getElementData(source, 'onProt') then -- Se o player que morreu não ter o elementData de key `onProt` não executará. return false end removeElementData(source, 'onProt') -- Remove o elementData de key `onProt` do player. end) 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