Nicolas ECM Posted May 29, 2016 Share Posted May 29, 2016 Hola a todos, sera que me podrian ayudar con un error del slothbot que es ERROR:Slothbot/sbclient.lua:115: attempt to compare boolean with number esa es la parte donde aparece el error, no se porque pasara porfavor ayuda function chase_shoot(ped) if (isElement(ped)) then local player = getElementData ( ped, "target" ) if (isElement(player)) and (getElementData (ped, "slothbot") == true) then if (getElementType(player) == "ped") or (getElementType(player) == "player") then if (getElementData ( ped, "status" ) == "chasing" ) and (isElement(player)) then if (getElementHealth(ped)>0) and (getElementHealth(player)>0) and (getElementData ( ped, "controller" ) == getLocalPlayer()) then local x,y,z = getElementPosition( player ) local ex,ey,ez = getElementPosition( ped ) local isclear = isLineOfSightClear (ex, ey, ez+1, x, y, z+1, true, false, false, true, false, false, false) if isclear == true then -- if the ped can see the local player local distance = (getDistanceBetweenPoints3D (ex, ey, ez, x, y, z)) if (getPedWeapon(ped) < 19) and (getPedWeapon(ped) ~= 9) then -- if its a melee weapon hat isnt a chainsaw if (distance < 2 ) then triggerServerEvent ( "pedShootTrigger", ped, "melee" ) setTimer ( chase_shoot, 2300, 1, ped, player ) else setTimer ( chase_shoot, 1500 ,1 , ped, player ) end Link to comment
Bc# Posted May 29, 2016 Share Posted May 29, 2016 if (isElement(player)) and (getElementData (ped, "slothbot") then Link to comment
Simple0x47 Posted May 30, 2016 Share Posted May 30, 2016 if (isElement(player)) and (getElementData (ped, "slothbot") then Intenta, porque a lo mejor se encuentra con 0 para false y 1 para true. if (isElement(player)) and (getElementData (ped, "slothbot") == 1) then Link to comment
Bc# Posted May 30, 2016 Share Posted May 30, 2016 En un if un 0 es false (nose si en lua tambien sea asi), por lo que no tienes necesidad de hacer la comparacion. Link to comment
Nicolas ECM Posted May 30, 2016 Author Share Posted May 30, 2016 Ya lo solucione muchas gracias Link to comment
Recommended Posts