mirror of
https://github.com/AiTechEye/portalgun.git
synced 2024-11-22 07:23:52 +01:00
Add files via upload
This commit is contained in:
parent
20213eb14f
commit
3316e88964
@ -1,15 +1,15 @@
|
||||
-- Code by UjEdwin
|
||||
|
||||
portalgun_power={}
|
||||
portalgun_power_tmp_power=0
|
||||
|
||||
function portalgun_gravity(itemstack, user, pointed_thing)
|
||||
local ob=pointed_thing.ref
|
||||
if ob:get_luaentity() and ob:get_luaentity().portalgun_power then
|
||||
ob:get_luaentity().target:set_detach()
|
||||
if ob:get_luaentity().target:get_luaentity() and (ob:get_luaentity().target:get_luaentity().itemstring or ob:get_luaentity().target:get_luaentity().wsc) then
|
||||
ob:get_luaentity().target:set_velocity({x=0, y=-1, z=0})
|
||||
ob:get_luaentity().target:set_acceleration({x=0, y=-8, z=0})
|
||||
local at = ob:get_attach()
|
||||
if at and at:get_luaentity() and at:get_luaentity().portalgun_power then
|
||||
ob:set_detach()
|
||||
local target = at:get_luaentity().target
|
||||
if target and target:get_luaentity() and (target:get_luaentity().itemstring or target:get_luaentity().wsc) then
|
||||
target:set_velocity({x=0, y=-1, z=0})
|
||||
target:set_acceleration({x=0, y=-8, z=0})
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
@ -21,6 +21,13 @@ function portalgun_gravity(itemstack, user, pointed_thing)
|
||||
ob:set_attach(m, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
4
mod.conf
Normal file
4
mod.conf
Normal file
@ -0,0 +1,4 @@
|
||||
name = portalgun
|
||||
description = Portals and stuff
|
||||
depends = default
|
||||
optional_depends = mesecons
|
Loading…
Reference in New Issue
Block a user