--GAME.lua
players = {}
for i = 1, 24 do
players[i] = nil
end
ss=5
function Game.Rule:OnPlayerSpawn (player)
player.health=10
end
function Game.Rule:OnPlayerAttack (victim, attacker, damage, weapontype, hitbox)
return 5
end
function Game.Rule:OnPlayerSignal (player, signal)
if signal>=0 and signal<=100 then
player.model=signal
end
end
function Game.Rule:OnUpdate (time)
--print("ss:",ss)
ss=ss-1
if ss<=0 then
for i,p in pairs(players) do
if p ~= nil and i ~= nil then
if p.health<p.maxhealth and p.model~=22 and p.model~=39 then
p.health=p.health+1--回血
print("[",i,"]回血")
end
if p.position.z<20 then
p.position=({x=0,y=0,z=30})
print("[",i,"]傳送")
end
end
end
ss=5
end
end
function Game.Rule:OnPlayerConnect(player)
players[player.index] = player
end
function Game.Rule:OnPlayerDisconnect(player)
players[player.index] = nil
end
--UI.lua
function UI.Event:OnChat(msg)
print("tonumber(msg):",tonumber(msg))
local msg1=tonumber(msg)
if tonumber(msg)==nil then
elseif tonumber(msg)>=0 and tonumber(msg)<=100 then
UI.Signal(msg1)
end
end