Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onLoad(save_state)
- self.createButton({
- click_function = "removePlayer",
- function_owner = self,
- label = "",
- position = {0,0.05,0},
- color = {0, 0, 0, 0},
- width = 2400,
- height = 600
- })
- end
- function removePlayer()
- local posSelf = self.getPosition()
- local pos = {x = posSelf.x, y = posSelf.y - 0.05, z = posSelf.z - 8.17}
- local bagPos = {pos.x + 0.62, pos.y + 1, pos.z - 33}
- local hittedBag = false
- local zone
- if pos.x < -20 then
- zone = "49a4e0"
- elseif pos.x < 0 then
- zone = "dac936"
- elseif pos.x < 20 then
- zone = "62cd94"
- else
- zone = "963318"
- end
- for i,j in pairs(getObjectFromGUID(zone).getObjects()) do
- if j.tag == "Bag" then
- j.setPosition({pos.x, pos.y + 1, -28})
- hittedBag = j
- end
- end
- for u,v in pairs(getObjectFromGUID(zone).getObjects()) do
- if hittedBag then
- if v.getGUID() ~= "dff000" and v.getGUID() ~= "42d2b6" and v ~= self then
- hittedBag.putObject(v)
- end
- else
- if v.getName():find("Player Mat") then
- v.destruct()
- end
- end
- end
- self.setState(1)
- end
Add Comment
Please, Sign In to add comment