Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p={imageid=0,objectid=0}
- p_id={}
- cannon_img={}
- images={"16122fe5c02.png","16122fe8dd9.png","16122feae9d.png","16122fee7e0.png","16122ff0e62.png"}
- function eventNewPlayer(name)
- p[name]={}
- cannon_img[name]=images[1]
- for name, p in pairs(tfm.get.room.playerList) do
- for _,keys in pairs({32}) do
- system.bindKeyboard(name, keys, true, true)
- end
- end
- end
- table.foreach(tfm.get.room.playerList,eventNewPlayer)
- function eventKeyboard(name, key, down, x, y)
- if not tfm.get.room.playerList[name].isDead then
- if key == 32 then
- p[name].objectid=tfm.exec.addShamanObject(17, x, y+15, 180, 0, 800, false)
- p[name].imageid=tfm.exec.addImage(cannon_img[name], "#"..tostring(p[name].objectid), 0, -5)
- end
- end
- end
- function eventChatCommand(name,cmd)
- local args={}
- for s in cmd:gmatch("%S+") do
- table.insert(args, s)
- end
- cmd=args[1]:lower()
- if args[1] == "img" then
- id = tonumber(args[2])
- if id <= #images and id > 0 then
- cannon_img[name]=images[id]
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement