• Player:IsSomething. Add a custom Player:Is
    6 replies, posted
Hello. Excuse me for any grammatical errors. I would like to know how to make a custom Player:Is, for example, in ttt if you want to make a script that works on a traitor, you can use the code Player:IsTraitor. I want to make, for example, Player:IsSomething, in my script, how can I do it? Thank you!
here's an example: [CODE] local player = FindMetaTable("Player") hook.Add("PlayerSpawn", "setissomething", function(ply) ply.issomething = false end) function player:CheckIsSomething() return self.issomething --> This will return false, since ply.issomething was set to false above. Keep in mind, "self" is the player we are running this on. end [/CODE]
[QUOTE=Tupac;50600115]here's an example: [CODE] local player = FindMetaTable("Player") ply.issomething = false function player:CheckIsSomething() return self.issomething --> This will return false, since ply.issomething was set to false above (Not correctly). Keep in mind, "self" is the player we are running this on. end [/CODE][/QUOTE] Thank you. So in another script, can I use if Player:IsSomething then ... ?
(Delete this answer. I was to slow :P.)
[QUOTE=markusmarkusz;50600141](Delete this answer. I was to slow :P.)[/QUOTE] I'm sorry, how to delete it?
[QUOTE=Predda;50600139]Thank you. So in another script, can I use if Player:IsSomething then ... ?[/QUOTE] The function will return either true or false. So you can use it in that case.
[QUOTE=Tupac;50600209]The function will return either true or false. So you can use it in that case.[/QUOTE] Thank you very much! ^^
Sorry, you need to Log In to post a reply to this thread.