Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Options
- spawnCooldown = 1000
- snowballPower = 10
- canPlayerRespawn = false -- false or true
- --
- tfm.exec.snow(1,snowballPower)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- function eventPlayerDied(playerName)
- if canPlayerRespawn then tfm.exec.respawnPlayer (playerName) end
- end
- -- by zigwin
- --system.bindMouse(admin, true)
- playerData={}
- function eventNewPlayer(playerName)
- system.bindMouse(playerName, true)
- tfm.exec.respawnPlayer (playerName)
- playerData[playerName]={cooldown=3000}
- end
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- function radiusPointFromMouse(xMousePosition, yMousePosition, radius, playerName)
- local angle = 0
- if tfm.get.room.playerList[playerName].y >= yMousePosition then
- angle = angle+180
- end
- xMousePosition = xMousePosition - tfm.get.room.playerList[playerName].x
- yMousePosition = -(yMousePosition - tfm.get.room.playerList[playerName].y)
- if not radius then radius = 50 end
- angle = angle + math.atan(xMousePosition / yMousePosition) / math.pi * 180
- return radius*xMousePosition/math.ceil(math.sqrt(xMousePosition^2 + yMousePosition^2)), radius*yMousePosition/math.ceil(math.sqrt(xMousePosition^2 + yMousePosition^2)), angle
- end
- function eventMouse(playerName, xMousePosition, yMousePosition)
- if os.time() > playerData[playerName].cooldown then
- playerData[playerName].cooldown = os.time() + spawnCooldown
- local x, y, angle = radiusPointFromMouse(xMousePosition, yMousePosition, 50, playerName)
- y = -y
- xSpeed = (xMousePosition - tfm.get.room.playerList[playerName].x)/10
- ySpeed = (yMousePosition - tfm.get.room.playerList[playerName].y)/10
- tfm.exec.addShamanObject(34, x+tfm.get.room.playerList[playerName].x, y+tfm.get.room.playerList[playerName].y, angle, xSpeed, ySpeed)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement