Jump to content

[HELP] Scrip Errors Need help


Recommended Posts

local pbags = { 
    {2293.154296875, 561.470703125, 7.78125}, 
} 
  
marker = createMarker(2291.1999511719, 537, 0.80000001192093, "cylinder", 1.5, 255, 0, 0) 
x, y, z = unpack(pbags[math.random(#pbags)])     
baga = createPickup(x, y, z, 3, 1210) 
  
function onPickupHit(player) 
    if source == baga then 
        if not isPedInVehicle(player) and not isPedDead(player) then 
            bagb = createObject(1210, 0, 0, 0) 
            exports.bone_attach:attachElementToBone(bagb,player,12,0,0.1,0.3,0,180,0) 
            destroyElement(source) 
        end 
    end 
end 
addEventHandler("onPickupHit", root, onPickupHit) 
      
function onMarkerHit(player) 
    if getElementType(player) == "player" then 
        local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) 
        if atthedTo == player then 
            local money = math.random(1000, 2000) 
            givePlayerMoney(player, money) 
            outputChatBox("You've Earned $"..money, player, 0, 255, 0, false) 
            destroyElement(bagb) 
        end 
    end 
end 
addEventHandler("onMarkerHit", marker, onMarkerHit) 
        
function onPlayerQuit() 
    local atthedTo = exports.bone_attach:getElementBoneAttachmentDetails(bagb) 
    if atthedTo == source then 
        destroyElement(bagb) 
        local x, y, z = getElementPosition(source) 
        baga = createPickup(x, y, z, 3, 1210) 
    end 
end 
addEventHandler("onPlayerQuit", root, onPlayerQuit) 

Thanks a lot

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