Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cabinetUsed(key,old)
- local objectWithData=getElementAttachedTo(source)
- if objectWithData==nil or objectWithData==false then return end
- if objects[objectWithData]==nil then return end
- if objects[objectWithData].cabinetUsed==false then return end
- local new=getElementData(source,key)
- if weapons[key]==nil then
- removeEventHandler("onElementDataChange",source,cabinetUsed)
- for _,player in pairs(getElementsByType("player")) do
- if getElementData(player,"currentCol")==source then
- if old==false or old==nil then
- old=0
- end
- setTimer(setElementData,200,1,player,key,getElementData(player,key))
- break
- end
- end
- setElementData(source,key,old)
- addEventHandler("onElementDataChange",source,cabinetUsed)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement