Jump to content

Help - Source


xXMADEXx

Recommended Posts

Im making a robbing script, but im having issues with the timer.

The "source" wont carry over into the timer, and i don't know how to make it....

so, it wont give the player the money.

cash = math.random(3000,8000) 
addEventHandler("onPlayerTarget",root, 
    function (target) 
        if (getElementData(source,"Job")=="Robber") then 
            if (getElementData(target,'thePoorFuckingSeller')=="fuckEmUp") then 
                if (getElementData(source,'robbingBurgurShot')=="true") then 
                    triggerClientEvent(source,'message:addMessage',source,'Robbery: Your already robbing a fast food restaurant!') 
                else 
                    outputChatBox("Robbery: You have started the robbbery. Don't get killed, or arrested.",source,255,255,0) 
                    setElementData(source,'robbingBurgurShot','true',true) 
                    payTimer = setTimer( 
                        function () 
                            givePlayerMoney(source,cash) 
                            outputChatBox("Robber: You have robbed Burgur Shot and have been paid $"..cash,source,0,255,0) 
                            setElementData(source,"robbingBurgurShot","false",true) 
                        end, 3000, 1 
                    ) 
                end 
            end 
        end 
    end 
) 

Link to comment
Guest Guest4401
cash = math.random(3000,8000) 
addEventHandler("onPlayerTarget",root, 
    function (target) 
        if (getElementData(source,"Job")=="Robber") then 
            if (getElementData(target,':O')==":O") then 
                if (getElementData(source,'robbingBurgurShot')=="true") then 
                    triggerClientEvent(source,'message:addMessage',source,'Robbery: Your already robbing a fast food restaurant!') 
                else 
                    outputChatBox("Robbery: You have started the robbbery. Don't get killed, or arrested.",source,255,255,0) 
                    setElementData(source,'robbingBurgurShot','true',true) 
                    local p = source 
                    payTimer = setTimer( 
                        function () 
                            givePlayerMoney(p,cash) 
                            outputChatBox("Robber: You have robbed Burgur Shot and have been paid $"..cash,p,0,255,0) 
                            setElementData(p,"robbingBurgurShot","false",true) 
                        end, 3000, 1 
                    ) 
                end 
            end 
        end 
    end 
) 

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