• detect when player spawned
    9 replies, posted
How do i detect if a player is spawned? PlayerInitialSpawn gets called when the player is still loading.
hook.Add("PlayerSpawn","UniqueName",function() -- whatever you want to happen here end)
Here's the GM Wiki page for the PlayerSpawn event as shown above: GM/PlayerSpawn
Do you mean this
I'm using PostRender hook. If you need to know server about it -- net.Send it
As long as you don't put anything important to it. If sv_allowcslua is on, then people could just trigger this whenever they want and it wouldn't be great. There are better ways.
One separate hook for sending player's "ready" state. And triggering derma that needs to be showed firstly. If he already send it, then do nothing.
How do you know that the OP wanted to show a derma? What if it (for some reason) OPed them if the net message had a certain string or boolean in it? Talk about a loophole.
https://files.facepunch.com/forum/upload/104786/6aa33afd-5305-46aa-857f-0f11b8609202/sublime_text_2018-02-13_18-15-00.png
Returning end will break all the hooks afterwards, possibly even the entire game. Also please put net.Start and net.SendToServer on different lines. The main point that I was trying to make is that you shouldn't make the net message important, because if allow clientside lua is on, they can do this net.Start("backdoor1") net.WriteBool(true) net.SendToServer() -- On server net.Receive("backdoor1", function(leng,ply) -- Good so far, but don't make it important! if net.ReadBool() then -- No... ply:GodEnable() -- No!!!! end end )
Sorry, you need to Log In to post a reply to this thread.