Jump to content

[AJUDA] Script não está funcionando


Recommended Posts

Bom dia, boa tarde ou boa noite. Estou fazendo um sistema de colete simples ( já citado em outro topico porém não é o mesmo assunto ) , estou com um erro / duvida sobre if . A intensão  desse codigo é pegar o dinheiro do player e se caso ele tenha a quantia ( R$5,000 ) ele irá receber um colete 100%. Porém eu devo ter feito algo errado com os if's . Irei mandar o codigo:

-------- FUNÇÕES MARKER --------
local markercolete = createMarker ( 2778.805, -2464.57, 13.636 -1, "cylinder", 1.5, 255, 255, 0, 255)

 function msgM(thePlayer)
    exports.Gunner_MensagensDX:outputDx ( thePlayer, "Digite /colete para comprar um colete ( R$5,000 )", "info" )
end
addEventHandler("onMarkerHit", markercolete, msgM)

-------- FUNÇÕES PRINCIPAIS--------

function pegarcolete(thePlayer, command, Preco )
	local Money = getPlayerMoney(thePlayer)
	local Valor = 5000
	if Money >= Valor then
	if isElementWithinMarker(thePlayer, markercolete) then
    setPlayerArmor ( thePlayer, 100 )
    exports.Gunner_MensagensDX:outputDx ( thePlayer, "Colete comprado com sucesso!", "success" )
    takePlayerMoney(thePlayer, Valor)
    else
    exports.Gunner_MensagensDX:outputDx ( thePlayer, "Você não está no local certo!", "error" )
end
end
end
addCommandHandler ( "colete", pegarcolete )

 

Link to comment
  • Other Languages Moderators

Parabéns por encontrar o erro sozinho. Sobre a deleção de tópicos, infelizmente não é possível realizar essa ação com uma conta normal, ou seja, apenas administradores podem. (geralmente eles não deletam, precisa ter um motivo claro)

  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...