Post: quick gsc function question
09-03-2015, 03:38 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); just a quick question i have a function called in playerspawned() and i want it to not apply to one of the teams, i know i could just define it to only be for a certain team, but in my case i can't and can't be bothered setuping up that

is there a simple way i can make it so it ignores it for example

if(self == on other team blah blah())
{
self thread examplefunction(); == false;
}

while that above is not right at all and would give a syntax error
hopefully it gives you an idea of what i'm looking for

thanks Smile
(adsbygoogle = window.adsbygoogle || []).push({});
09-03-2015, 03:59 AM #2
HiddenHour
I defeated!
Originally posted by OfficialCoolJay View Post
just a quick question i have a function called in playerspawned() and i want it to not apply to one of the teams, i know i could just define it to only be for a certain team, but in my case i can't and can't be bothered setuping up that

is there a simple way i can make it so it ignores it for example

if(self == on other team blah blah())
{
self thread examplefunction(); == false;
}

while that above is not right at all and would give a syntax error
hopefully it gives you an idea of what i'm looking for

thanks Smile


Try looking into self.pers["team"]
    function()
{
foreach(player in level.players)
{
if(player.pers["team"] == self.pers["team"])//If player is on my team
{
//do stuff
}
}
}
09-03-2015, 04:05 AM #3
it is for free for all that is why i say it cant be done i just want to know how to make it so it ignores a function that is being called
09-03-2015, 04:10 AM #4
HiddenHour
I defeated!
Originally posted by OfficialCoolJay View Post
it is for free for all that is why i say it cant be done i just want to know how to make it so it ignores a function that is being called


I'm sorry, but I seriously can't understand what you're trying to do. Do you want it so that if the player is not on your team then it doesn't start a function?
09-03-2015, 04:25 AM #5
jwm614
NextGenUpdate Elite
Originally posted by OfficialCoolJay View Post
just a quick question i have a function called in playerspawned() and i want it to not apply to one of the teams, i know i could just define it to only be for a certain team, but in my case i can't and can't be bothered setuping up that

is there a simple way i can make it so it ignores it for example

if(self == on other team blah blah())
{
self thread examplefunction(); == false;
}

while that above is not right at all and would give a syntax error
hopefully it gives you an idea of what i'm looking for

thanks Smile




    

host = gethostplayer();
if(host.pers["team"] == self.pers["team"] )
{
//yourteam
}

if(host.pers["team"] != self.pers["team"] )
{
//enemyteam
}
09-03-2015, 05:36 AM #6
its for my custom gamemode, its for free for all, it chooses a individual player to be "it" for the gamemode.
it looks like this

    if(self.name == level.hunter.name && level.gameStarted == true)


thats how you call the player right

i want it so that this person who is it cannot use a function that everyone else has
this is the format im going for
    if(self.name == level.hunter.name && level.gameStarted == true)
{
self thread examplefunction(); == false
}

thats basically how i want it
this part here
    self thread examplefunction(); == false

is incorrect and i don't know how to code it properly
sorry its really hard to explain
09-03-2015, 12:44 PM #7
HiddenHour
I defeated!
Originally posted by OfficialCoolJay View Post
its for my custom gamemode, its for free for all, it chooses a individual player to be "it" for the gamemode.
it looks like this

    if(self.name == level.hunter.name && level.gameStarted == true)


thats how you call the player right

i want it so that this person who is it cannot use a function that everyone else has
this is the format im going for
    if(self.name == level.hunter.name && level.gameStarted == true)
{
self thread examplefunction(); == false
}

thats basically how i want it
this part here
    self thread examplefunction(); == false

is incorrect and i don't know how to code it properly
sorry its really hard to explain


    function()
{
if(self.name != level.hunter.name)//If they arent the hunter, do a function
self thread moreStuff();
}

Sort of like that?
09-04-2015, 12:44 AM #8
yes except trying to apply that self thread moreStuff(); to the hunter i want it so it ignores the function i tell it to ignore like this

    function()
{
if(self.name == level.hunter.name && level.gameStarted == true)
{
self thread giveknifeblahblah(); == false for example ignore this function (i want it to ignore this function right here)
}
}


you might say well then don't put the function in then and it wont use it. the thing is its a function called in playerspawned() and applys to all players
and i want it so that the hunter can't use it, but i cant define teams and just give everyone else the function because its not team deathmatch and is free for all
so i want to make a function that makes it so that if your the hunter you ignore that function but i dont know how to write the proper coding for that
for example i showed you this

    self thread giveknifeblahblah(); == false


to give you an idea of want i want ^ that would give me a syntax error
but you can see im trying to set that function as false for the hunter so he will ignore and not use that function

maybe this will also help you understand what i mean

    function()
{
self thread blah blah;

else
{
if(self.name == level.hunter.name && level.gameStarted == true)
{
dont do self thread blah blah;
}
}
}


if there isnt a way to do what im asking i wont worry about it
it would just save me alot of time
09-04-2015, 01:22 AM #9
jwm614
NextGenUpdate Elite
Originally posted by OfficialCoolJay View Post
yes except trying to apply that self thread moreStuff(); to the hunter i want it so it ignores the function i tell it to ignore like this

    function()
{
if(self.name == level.hunter.name && level.gameStarted == true)
{
self thread giveknifeblahblah(); == false for example ignore this function (i want it to ignore this function right here)
}
}


you might say well then don't put the function in then and it wont use it. the thing is its a function called in playerspawned() and applys to all players
and i want it so that the hunter can't use it, but i cant define teams and just give everyone else the function because its not team deathmatch and is free for all
so i want to make a function that makes it so that if your the hunter you ignore that function but i dont know how to write the proper coding for that
for example i showed you this

    self thread giveknifeblahblah(); == false


to give you an idea of want i want ^ that would give me a syntax error
but you can see im trying to set that function as false for the hunter so he will ignore and not use that function

maybe this will also help you understand what i mean

    function()
{
self thread blah blah;

else
{
if(self.name == level.hunter.name && level.gameStarted == true)
{
dont do self thread blah blah;
}
}
}


if there isnt a way to do what im asking i wont worry about it
it would just save me alot of time


    function()
{
if(self.name != level.hunter.name && level.gameStarted == true)
self thread blah();
}
09-04-2015, 01:46 AM #10
HiddenHour
I defeated!
Originally posted by OfficialCoolJay View Post
yes except trying to apply that self thread moreStuff(); to the hunter i want it so it ignores the function i tell it to ignore like this

    function()
{
if(self.name == level.hunter.name && level.gameStarted == true)
{
self thread giveknifeblahblah(); == false for example ignore this function (i want it to ignore this function right here)
}
}


you might say well then don't put the function in then and it wont use it. the thing is its a function called in playerspawned() and applys to all players
and i want it so that the hunter can't use it, but i cant define teams and just give everyone else the function because its not team deathmatch and is free for all
so i want to make a function that makes it so that if your the hunter you ignore that function but i dont know how to write the proper coding for that
for example i showed you this

    self thread giveknifeblahblah(); == false


to give you an idea of want i want ^ that would give me a syntax error
but you can see im trying to set that function as false for the hunter so he will ignore and not use that function

maybe this will also help you understand what i mean

    function()
{
self thread blah blah;

else
{
if(self.name == level.hunter.name && level.gameStarted == true)
{
dont do self thread blah blah;
}
}
}


if there isnt a way to do what im asking i wont worry about it
it would just save me alot of time


    onPlayerSpawned()
{
if(self.name != level.hunter.name && level.gamestarted == true)//If the game is started and the player is not the hunter
self thread giveKnifeBlahblah();
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo