Page 1 of 1

[SCRIPT] Unbound

Posted: Sat Apr 27, 2013 1:55 pm
by thepolm3
This is a little something I whipped up that, nothing fancy, allows players to walk right ff the edge of the map.
Cododode
Code: Select all

"""
unbound by thepolm3
removes map boundaries
"""
from twisted.internet.task import LoopingCall

def apply_script(protocol,connection,config):
    class UnboundProtocol(protocol):
        pass
    class UnboundConnection(connection):
        save_vel=0.0
        loop=None
        def pos(self):
            position=self.world_object.position
            return position.x,position.y,position.z

        def goOverEdge(self):
            world_object=self.world_object
            if world_object:
                x,y,z=self.pos()
                if x>=511:
                    if self.world_object.velocity.x > 0:
                        self.world_object.set_position(0.5,y,z)
                if x<=1:
                    if self.world_object.velocity.x < 0:
                        self.world_object.set_position(511.5,y,z)
                if y>=511:
                    if self.world_object.velocity.y > 0:
                        self.world_object.set_position(x,0.5,z)
                if y<=1:
                    if self.world_object.velocity.y < 0:
                        self.world_object.set_position(x,511.5,z)

        def on_spawn(self,pos):
            if not self.loop:
                self.loop=LoopingCall(self.goOverEdge)
                self.loop.start(0.01)
            return connection.on_spawn(self,pos)

    return UnboundProtocol,UnboundConnection

Spoiler:
Blue_Happy1 Blue_BigSmile Blue_Happy3 Blue_Sunglasses1 Blue_Wink1 Blue_D'oh Blue_Normal Blue_Sleeping Blue_Surprised2 Blue_NotHappy Blue_Crying Blue_Septic Blue_Spade Blue_Rifle Blue_Pistol Blue_Pistol2 Blue_Angry Blue_Brasil Blue_Crying2 Blue_Devil1

Re: [SCRITP] Unbound

Posted: Sat Apr 27, 2013 11:16 pm
by TB_
Well then, what happens when they walk off the map? do they appear on the other side, or can they walk as the chunks rendered go?

Re: [SCRITP] Unbound

Posted: Sun Apr 28, 2013 1:33 am
by TheScar
How to use

Re: [SCRITP] Unbound

Posted: Sun Apr 28, 2013 12:25 pm
by thepolm3
sorry, yes makes them walk to other side