Answered attach to player code

xexheelix

Known Member
Messages
10
Reaction score
2
Points
108
Code:
attachtoplayer(player)
{
    if(self.linktohim == 0)
    {
        self iPrintln("Attached To Player");
        self playerlinkto(player, "j_head");
        self thread toggleDemiGod();//not needed
        self.linktohim = 1;
    }
    else
    {
        self iPrintln("Detached From Player");
        self thread toggleDemiGod();//not needed
        self.linktohim = 0;
        self unlink();
    }
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
attachtoplayer(player)
{
if(self.linktohim == 0)
{
self iPrintln("Attached To Player");
self playerlinkto(player, "j_head");
self thread toggleDemiGod();//not needed
self.linktohim = 1;
}
else
{
self iPrintln("Detached From Player");
self thread toggleDemiGod();//not needed
self.linktohim = 0;
self unlink();
}
}
What is your question? Does the script not work?
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
lol forgot to say the question and yea it works but the god mode is not work idk why
You need to add a godmode function to it. :smile: If you send me your godmode function I can add it!
 

xexheelix

Known Member
Messages
10
Reaction score
2
Points
108
this?
Code:
toggleDemiGod()
{
if(self.healthy==false)
{
self thread demigod();
self.maxhealth = 2144999999;
self.health = 2144999999;
self.healthy = true;
}
else
{
if(self.healthy==true)
{
self.maxhealth = 100;
self.health = 100;
self DisableInvulnerability();
self notify("playlegitscrub");
self.healthy = false;
}
}
}

demigod()
{
self endon("death");
self endon("disconnect");
self endon("playlegitscrub");
for(;;)
{
self.health = 2144999999;
wait 0.05;
self.health = 2144999999;
wait 0.05;
}
wait 0.05;
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
this?
Code:
toggleDemiGod()
{
if(self.healthy==false)
{
self thread demigod();
self.maxhealth = 2144999999;
self.health = 2144999999;
self.healthy = true;
}
else
{
if(self.healthy==true)
{
self.maxhealth = 100;
self.health = 100;
self DisableInvulnerability();
self notify("playlegitscrub");
self.healthy = false;
}
}
}

demigod()
{
self endon("death");
self endon("disconnect");
self endon("playlegitscrub");
for(;;)
{
self.health = 2144999999;
wait 0.05;
self.health = 2144999999;
wait 0.05;
}
wait 0.05;
}
Yes, so the godmode does not work? correct?
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
yea keep geting killed with it on
Ok, is it a problem for you if it's not demi godmode, if you're using enableInvulnerability(); you won't die.


Replace your attach function with that:
Code:
attachtoplayer(player)
{
    if(self.linktohim == 0)
    {
        self iPrintln("Attached To Player");
        self playerlinkto(player, "j_head");
        self enableInvulnerability();
        self.linktohim = 1;
    }
    else
    {
        self iPrintln("Detached From Player");
        self disableInvulnerability();
        self.linktohim = 0;
        self unlink();
    }
}
 

xexheelix

Known Member
Messages
10
Reaction score
2
Points
108
Ok, is it a problem for you if it's not demi godmode, if you're using enableInvulnerability(); you won't die.


Replace your attach function with that:
Code:
attachtoplayer(player)
{
    if(self.linktohim == 0)
    {
        self iPrintln("Attached To Player");
        self playerlinkto(player, "j_head");
        self enableInvulnerability();
        self.linktohim = 1;
    }
    else
    {
        self iPrintln("Detached From Player");
        self disableInvulnerability();
        self.linktohim = 0;
        self unlink();
    }
}
Thanks
 

xexheelix

Known Member
Messages
10
Reaction score
2
Points
108
ok i will try that and do you think it will crash the game if i make attach all function
 
Top