Jump to content

[HELP] DESTROY WANTEDLEVEL


#RooTs

Recommended Posts

I'm new to scripts, how can I create a "Pickup" that destroys 1 level of WantedLevel at a particular location on the map

547e765fe0b4f2955962f6a8c02fca02.png

createPickup (1548, -1681, 13, 3, 1239, 60000 ) 

Can someone help me?

Sorry my english...

More or less like this:

Edited by Guest
Link to comment
  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Huh ? anyways if you don't understand, then you can use this code

local test = createPickup (1548, -1681, 13, 3, 1239, 60000 ) 
  
addEventHandler("onPickupHit",test, 
function(player) 
setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) 
end) 

Link to comment

Try this

function dede() 
setTimer(function() 
test = createPickup (1548, -1681, 13, 3, 1247, 60000 ) 
addEventHandler("onPickupHit",test,onHitStar) 
end,60000,1) 
end 
  
  
function onHitStar(player) 
setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) 
destroyElement(test) 
removeEventHandler("onPickupHit",test,onHitStar) 
dede() 
end 

Link to comment

This works, tested it myself.

function dede() 
setTimer(function() 
test = createPickup (2720.3171386719, 2123.2409667969, 6.7327833175659, 3, 1247, 60000 ) 
addEventHandler("onPickupHit",test, 
function() 
setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) 
destroyElement(test) 
end) 
end,60000,0) 
end 
addEventHandler("onResourceStart",resourceRoot,dede) 

Edited by Guest
Link to comment

have to test with your level sought +2

and grab the star with and without vehicle

[gamemode: play and deathmatch]

meta.xml

    "Twerky" type="script" version="1.0.0" name="Destroy Star WantedLevel" description="Destroy Star WantedLevel" /> 
        

star.lua

function dede() 
setTimer(function() 
test = createPickup (653.35773, -1769.18567, 13.57368, 3, 1247, 10000 ) 
addEventHandler("onPickupHit",test, 
function() 
setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) 
destroyElement(test) 
removeEventHandler("onPickupHit",test,onHitStar) 
end) 
end,10000,0) 
end 
addEventHandler("onResourceStart",resourceRoot,dede) 

not working with me

Link to comment

try this, but i haven't tested.

test = createPickup (1660, 296, 21, 3, 1247, 6000 ) 
  
  
  
function destroy(player) 
destroyElement(test) 
setPlayerWantedLevel(player,getPlayerWantedLevel(player)-1) 
  
function delay() 
test = createPickup (1660, 296, 21, 3, 1247, 6000 ) 
end 
setTimer ( delay, 6000, 1 ) 
  
end 
addEventHandler("onPickupHit",test,destroy) 
  
  
  

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