Liberty Unleashed
Scripting => Script Help => Topic started by: Motley on October 28, 2015, 08:47:06 pm
-
I would like to create a script for my server that on certain skin ids you cannot kill. basically say skin 0 Claude if you are 0 you can not kill. as well if you are with skin = hobos, gangs, pimps, hookers, etc. i really don't know how i should start this script. i should be able to create the script and copy and paste it over and over until complete .
Any help would be nice on configuring this script.
This is a main script i need on my server.
Thanks for reading
-
try something like IfPlayerSkin( == id );
player.Immune = true;
i dont know
-
i feel like this would belong in the section of
function onPlayerSkin
i will play around with this.
Thank you
-
Wont work >:(. nothing but errors now i feel like your avatar, Luckily this is day one and i already have a suggestion maybe with your help and someone else i can figure this out.
Thank you.
ill Research God mode in the forums and see what i can use and modify the god mode with what you gave me.
-
try
function onPlayerSkin( player, skin );
{
ifPlayerSkin == 1;
player.Immune = true;
}
works?
-
function onPlayerSkinChange( player, old, new )
{
if (new == 1) player.Immune = true;
else player.Immune = false;
return 1;
}
-
This is awesome thank you. Have not tested. only issue i did not realize is this should of been created as a class script. for instance if you are tonny cipriani then you should be immune to anyone else's skin related/gang related. but if not it's fine i can literally get it working and maybe modify it. Thanks so much rwwpl. Trevor you we're very close. i really appreciate your attempts to help me.
-
function onPlayerSkinChange( player, old, new )
{
if (new == 1) player.Immune = true;
if (new == 5) player.Immune = true;
else player.Immune = false;
return 1;
}
something like this may work.
-
i know, im not a scripting master.
-
okay the actual script works but in the spawn screen if you go to the skin that way it dosnt work, unless you type /skin even if you are that skin already... no clue to why this is like this. i will have to play with the actual script
-
player.Skin = skinid; maybe
-
okay the actual script works but in the spawn screen if you go to the skin that way it dosnt work, unless you type /skin even if you are that skin already... no clue to why this is like this. i will have to play with the actual script
Because that function is triggered only when the player changes its skin and thus spawning with a skin isn't considered a "change". Try:
function onPlayerSpawn( player, spawn )
{
if (player.Skin == 1) player.Immune = true;
else player Immune = false;
}
This function is triggered when you leave the spawnscreen upon join, as well as everytime you die and respawn.
-
hmm appears this creates god mode instead on that player only way to be able to kill is threw head shot i will play with it more. i appreciate everyone's help.
function onPlayerSpawn( player, spawn )
{
if (player.Skin == 1) player.Immune = true;
else player Immune = false;
}
This function is triggered when you leave the spawnscreen upon join, as well as everytime you die and respawn.
-
That's because the headshot.nut client script, overrides this server script, so you can either disable the headshot script, or making a godmode script through client, here is a topic (http://forum.liberty-unleashed.co.uk/index.php/topic,1691.0.html) which shows different ways of creating godmode through client, then you'd just need to add a way to check skin for it.
-
I really appreciate everything.
until i fix it completely ill just set message player on spawn to type there skin /skin of there selected player after each time killed to ensure that there team don't kill them.
until i find a way to do something like findplayerskin function with a timer.. idk something
ill figure something out the main objective is complete.
Thanks to everyone
Ps im applauding everyone