HelpWhy the hell does this not work in most servers

Posts 111 of 11 · Page 1 of 1
Quote Originally Posted by rayts5 View Post
http://wiki.garrysmod.com/page/Player/Nick

Nick() only works on the "player" entity, where you are calling "ents" in this case.

I believe it works if you switch: ents.GetAll -> player.GetAll.
I think you're the only person on this site that's not a troll.
Quote Originally Posted by ShitFucks View Post
I think you're the only person on this site that's not a troll.
MPGH is more serious when you go into other sections of it I would say.
Quote Originally Posted by rayts5 View Post
MPGH is more serious when you go into other sections of it I would say.
Yeah, I should have said section.

Any way you can modify this LocalPlayer():GetEyeTrace().Entity to work with this?

Code:
for k,v in pairs(player.GetAll()) do
	local rekt = LocalPlayer():GetEyeTrace().Entity
	if v:Nick() == rekt then 
		print("1234")
		else 
		print("4321")
		end
end
Quote Originally Posted by ShitFucks View Post
Any way you can modify this LocalPlayer():GetEyeTrace().Entity to work with this?

Code:
for k,v in pairs(player.GetAll()) do
	local rekt = LocalPlayer():GetEyeTrace().Entity
	if v:Nick() == rekt then 
		print("1234")
		else 
		print("4321")
		end
end
I am not really sure about why you would like to loop the players, since that is not necessary with the eyetrace. You could do something like:

Code:
if LocalPlayer():GetEyeTrace().Entity:Nick() == "PlayerName" then
print("1234")
else
print("4321")
end
I would refrain from variables, example "rekt" as they are creating an object in the heap, but that is just my personal preference.
Quote Originally Posted by rayts5 View Post
I am not really sure about why you would like to loop the players, since that is not necessary with the eyetrace. You could do something like: -snip-
Alright, I know I'm asking a lot of questions but this is my last and I've done most of it myself I just need help on these few things to perfect what I'm making. How can I go about setting a variable from ingame without reloading the file? So instead of using "local myvar = myvalue" I could set myvar from ingame.
Quote Originally Posted by ShitFucks View Post
Alright, I know I'm asking a lot of questions but this is my last and I've done most of it myself I just need help on these few things to perfect what I'm making. How can I go about setting a variable from ingame without reloading the file? So instead of using "local myvar = myvalue" I could set myvar from ingame.
I suppose that you could just define a global, example:

number = 100

Print that, and it's 100. Since you did not specify "local" in front of it, it is a global. You applied a number as well, which makes the var an integer.

Then later on, you could simply do:

number = 50, and print(number) again. The variable remains global to you, and call-able in all client-side files.

I guess you want to do this with the playername however?

Edit: If you want the variable to not reload to its default:

Code:
if !playername then
playername = "Name"
end
if LocalPlayer():GetEyeTrace().Entity:Nick() == playername then
print("1234")
else
print("4321")
end
Then simply call: playername = "Whatevernameyouwant" (Tested now)
wtf are you even trying to do
Quote Originally Posted by D3M0L1T10N View Post
wtf are you even trying to do
Print some fucking numbers to see if he is a robot or not gosh you dont get anything.
yeah and you couldn't take the time to read the pil even though it takes like 30 minutes
and if the trace's entity is not a player then name can't be called, why has no one realized this yet?
Posts 111 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?