I made this script and I was wanting it to run on myself when I join the server. I find it a bit annoying to run it on myself every time the map changes or I join.
Hook.Add playerinitialspawn, check if the steamid is your id then run the command
The only issue I seem to be having trouble with is having the command target me. I think I have the basis of the command setup correctly, but I am trying to figure out how to make it target me. I am trying to do it using ULXs runscriptcl command, although I would like to find a way to do it without the use of ULX.
So youre making a script wich you want to load for everyone on the server on join?
If its that, add a .lua on autorun and AddCSLua the file and then check if CLIENT and there include the file
I only want it to run on me, no one else.
Just asking:
Are you the owner of the server/have acces to the files?
If you have what you can do is on that autorun before incluiding it check LocalPlayers steamid and see if its yours
The hook solid_jake mentioned has the joining player as an argument, so you can just check if joining player:SteamID() equals yours, then run the function/lua script you want.
I do have access to the server files.
So I would need to create somefile.lua in the lua/autorun section of the server containing an AddCSLua section for my script and then to check for me via my steamid?
And after that include it
Sorry, you need to Log In to post a reply to this thread.