Jump to content

[HELP]house robber


Recommended Posts

idk what is wrong here but when i enter 1st marker the second marker placed by not coordinats that i put in script

local robberTable = 
{ 
{662.77813720703,-1466.8835449219,14}; 
{1081.1281738281,-1697.1042480469,13}; 
{1889.9724121094,-1102.2674560547,25}; 
{2502.1149902344, -1348.7891845703,29}; 
{2267.6799316406,-1670.7275390625,15}; 
{2322.2175292969,-1796.1129150391,13}; 
  
} 
  
function unpackRobber () 
    return unpack ( robberTable [ math.random ( #robberTable ) ] ) 
end 
  
function createRoute () 
   if ( source == buttonrob ) then 
        x, y, z = unpackRobber () 
        robbMarker = createMarker ( x, y, z, "cylinder", 1.5, 250, 0, 0, 85 ) 
        addEventHandler("onClientMarkerHit",robbMarker,unctrob) 
        robberBlip = createBlipAttachedTo( robbMarker, 32 ) 
    setElementVisibleTo( robbmarker, getRootElement(), false ) 
    setElementVisibleTo( robberblip, getRootElement(), false ) 
    setElementVisibleTo( robbmarker, source, true ) 
    setElementVisibleTo( robberblip, source, true ) 
   end 
end 
addEventHandler ( "onClientGUIClick", root, createRoute ) 
  
function unctrob ( hitElement ) 
    if ( not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then 
    triggerServerEvent ( "givePayRob", localPlayer ) 
    destroyElement ( robbMarker ) 
    destroyElement ( robberBlip ) 
    createRoute() 
    end 
end 
  
  
function fun () 
    cancelEvent () 
end 
addEventHandler ( "onClientPedDamage", resourceRoot, fun ) 

EDIT:It's placed by coordinats of another script wich is in that folder

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...