Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getBall(name, x, y)
- if ballObject.Spawn then
- if ballObject.owner == "" then
- local ballX1 = (tfm.get.room.objectList[ballObject.id].x - tfm.get.room.objectList[ballObject.id].vx) - 50
- local ballX2 = (tfm.get.room.objectList[ballObject.id].x + tfm.get.room.objectList[ballObject.id].vx) + 50
- local ballY1 = (tfm.get.room.objectList[ballObject.id].y - tfm.get.room.objectList[ballObject.id].vy) - 60
- local ballY2 = (tfm.get.room.objectList[ballObject.id].y + tfm.get.room.objectList[ballObject.id].vy) + 60
- if x >= ballX1 and x <= ballX2 and y >= ballY1 and y <= ballY2 then
- tfm.exec.removePhysicObject(1)
- ballObject.verifyCoords = false
- ballObject.Spawn = false
- canCatchBall()
- tfm.exec.removeObject(ballObject.id)
- idImage = tfm.exec.addImage("175aa78bb80.png", "$"..name, -45, -125, nil)
- ballObject.owner = name
- system.bindMouse(name, true)
- playersActions[name].canCatch = true
- showImageBallWithPlayer(name)
- eventKeyBoardControl(name, true)
- end
- elseif ballObject.owner ~= "" and playerTeam[ballObject.owner].team ~= playerTeam[name].team then
- local ballX1 = (tfm.get.room.playerList[ballObject.owner].x - tfm.get.room.playerList[ballObject.owner].vx) - distanceToCatch.x - playerDirection.x1
- local ballX2 = (tfm.get.room.playerList[ballObject.owner].x + tfm.get.room.playerList[ballObject.owner].vx) + distanceToCatch.x + playerDirection.x2
- local ballY1 = (tfm.get.room.playerList[ballObject.owner].y - tfm.get.room.playerList[ballObject.owner].vy) - distanceToCatch.y
- local ballY2 = (tfm.get.room.playerList[ballObject.owner].y + tfm.get.room.playerList[ballObject.owner].vy) + distanceToCatch.y
- if x >= ballX1 and x <= ballX2 and y >= ballY1 and y <= ballY2 then
- removeTimer("powerShoot")
- gameStats.powerShootEvent = false
- ui.removeTextArea(999)
- ui.removeTextArea(1000)
- ui.removeTextArea(1001)
- ballObject.verifyCoords = false
- ballObject.Spawn = false
- forceIndex = 0
- canCatchBall()
- tfm.exec.removeImage(idImage)
- tfm.exec.removeImage(ballObject.ID_image)
- delayCatchEVT(ballObject.owner)
- system.bindMouse(ballObject.owner, false)
- eventKeyBoardControl(ballObject.owner, false)
- idImage = tfm.exec.addImage("175aa78bb80.png", "$"..name, -45, -125, nil)
- ballObject.owner = name
- playersActions[name].canCatch = true
- showImageBallWithPlayer(name)
- system.bindMouse(ballObject.owner, true)
- eventKeyBoardControl(ballObject.owner, true)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement