Search
Latest topics
Similar topics
Most active topic starters
ZxC | ||||
>L.E.E< | ||||
NinjaAssasinX | ||||
Anonymous :D | ||||
halt drop or die | ||||
Street Workout | ||||
CrazyRussian | ||||
Flame Boy | ||||
COB®a | ||||
VeyroN <3 |
minecraft !
3 posters
Page 1 of 1
minecraft !
this is a lua safe zone script for minecraft server : (but only in tp area in "mc palstine lake"
paste it in server.lua
safe = {}
for _,e in pairs(entitylist()) do
if entity(e.x,e.y,"typename") == "Env_Hurt" and entity(e.x,e.y,"int0") == -100 and entity(e.x,e.y,"int1") == 2 then
local x=e.x
local y=e.y
local x2=(e.x-1)+entity(e.x,e.y,"int2")
local y2=(e.y-1)+entity(e.x,e.y,"int3")
table.insert(safe,{x,x2,y,y2})
end
end
function init_array(length,mode)
local array = {}
for i = 1,length do
array[i] = mode
end
return array
end
player_safe = init_array(32,false)
addhook("movetile","movetile")
addhook("hit","hit")
function hit(id)
if player_safe[id] then
return 1
end
return 0
end
function movetile(id,x,y)
for i in ipairs(safe) do
if x >= safe[i][1] and x <= safe[i][2] and y >= safe[i][3] and y <= safe[i][4] then
player_safe[id] = true
break
else
player_safe[id] = false
end
end
update_hud(id)
end
function update_hud(id)
if player_safe[id] then
parse("hudtxt2 "..id.." 1 \"SAFE ZONE\" 318 200 1")
else
parse("hudtxt2 "..id.." 1 \"\" 300 210 0")
end
end
paste it in server.lua
safe = {}
for _,e in pairs(entitylist()) do
if entity(e.x,e.y,"typename") == "Env_Hurt" and entity(e.x,e.y,"int0") == -100 and entity(e.x,e.y,"int1") == 2 then
local x=e.x
local y=e.y
local x2=(e.x-1)+entity(e.x,e.y,"int2")
local y2=(e.y-1)+entity(e.x,e.y,"int3")
table.insert(safe,{x,x2,y,y2})
end
end
function init_array(length,mode)
local array = {}
for i = 1,length do
array[i] = mode
end
return array
end
player_safe = init_array(32,false)
addhook("movetile","movetile")
addhook("hit","hit")
function hit(id)
if player_safe[id] then
return 1
end
return 0
end
function movetile(id,x,y)
for i in ipairs(safe) do
if x >= safe[i][1] and x <= safe[i][2] and y >= safe[i][3] and y <= safe[i][4] then
player_safe[id] = true
break
else
player_safe[id] = false
end
end
update_hud(id)
end
function update_hud(id)
if player_safe[id] then
parse("hudtxt2 "..id.." 1 \"SAFE ZONE\" 318 200 1")
else
parse("hudtxt2 "..id.." 1 \"\" 300 210 0")
end
end
DZiRi FoUaD- Admin
- Posts : 95
Thanks : 0
Join date : 2014-10-03
Age : 24
Location : algeria
Re: minecraft !
Nice and we need this lua to the safe zone for Minecraft, We need to wait Ajmin/Dice Put this lua in Minecraft.
TopNorTH- User
- Posts : 79
Thanks : -2
Join date : 2014-10-08
Age : 26
Location : Grand Britain
Re: minecraft !
Next time use the code button please.
Also this lua is not bad at all, but we need Ajmin to control this lua.
Also this lua is not bad at all, but we need Ajmin to control this lua.
ZxC- Owner
- Posts : 655
Thanks : 0
Join date : 2014-08-20
Location : Italy
Re: minecraft !
i am not very good in scripting maybe ajmin will fix it .
DZiRi FoUaD- Admin
- Posts : 95
Thanks : 0
Join date : 2014-10-03
Age : 24
Location : algeria
Re: minecraft !
I already installed safe zone script.
but it was leading to some bugs.
so unfortunately i removed it.
And this lua is 100% stolen.
Automatic safezone (USGN)
but it was leading to some bugs.
so unfortunately i removed it.
And this lua is 100% stolen.
Automatic safezone (USGN)
Guest- Guest
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
10/7/2015, 9:22 pm by Bus School
» The main forum has been moved
21/6/2015, 10:38 pm by Anonymous :D
» Application to be mod on saz server
28/3/2015, 7:33 pm by Anonymous :D
» Aplication mod
6/2/2015, 8:12 am by Ajmin
» Refurbishing the forum
4/2/2015, 6:44 pm by ZxC
» Ban appeals request
4/2/2015, 6:32 pm by ZxC
» Suggesting ideas
4/2/2015, 6:23 pm by ZxC
» Rule violation and banning
4/2/2015, 6:01 pm by ZxC
» Server Rules
4/2/2015, 5:57 pm by ZxC