Jump to content

Scripting help needed!


adamb

Recommended Posts

Posted

Hey, i just got a problem while scripting this, and i would need help with it.

It gives me this error: Bad arguement @ 'setElementParent' [Expected element at arguement 1, got nil]

setTimer(  
            function() 
            victimblip = createBlip(Mx, My, Mz, 0, 0, 0, 0, 1) 
            end, 1000, 0) 
            setElementParent(victimblip, theMugPlace) 
             

Posted

Thanks for the quick reply,

Tho, i need to delay SetElementParent with a timer? Can you show me how?

And i do need time to create the blip.

Posted
setTimer( 
    function ( ) 
        if isElement ( victimblip ) then 
            setElementParent ( victimblip,theMugPlace ) 
        end 
    end,1000,0) 

Posted

What's the point of that timer? you had one to create the blip, just add the setElementParent after you create it inside the same function.

Posted
What's the point of that timer? you had one to create the blip, just add the setElementParent after you create it inside the same function.

I'm making a police callout system, and i'm trying to make it as real as possible, so delaying it would make it more realistic, as real police doesn't get all their calls at the same time.

Posted

I'm not saying that you shouldn't use the timer to create it, I'm saying that you can use the same timer that creates it to set the parent.

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