• Making a spawnsystem using Vectors only
    35 replies, posted
GM will always be nil unless called from inside of the gamemode folders (or you set it) you MUST run it as a hook hook.Add ext ext
[code] GM = GAMEMODE [/code] Shouldn't that work for addons? easier would be replacing GM: with GAMEMODE:
[CODE] --nil function GAMEMODE:PlayerSelectSpawn(ply) print("TEST") end --working hook.Add("PostGamemodeLoaded", "test", function() function GAMEMODE:PlayerSelectSpawn(ply) print("TESADAWDWADAWDWAD") end end) [/CODE]
[QUOTE=P4sca1;49867146][CODE] --nil function GAMEMODE:PlayerSelectSpawn(ply) print("TEST") end --working hook.Add("PostGamemodeLoaded", "test", function() function GAMEMODE:PlayerSelectSpawn(ply) print("TESADAWDWADAWDWAD") end end) [/CODE][/QUOTE] then.. overwrite the function that way? :o
[QUOTE=whitestar;49867160]then.. overwrite the function that way? :o[/QUOTE] Yeah I just tried the whole code again with completely overwriting the function. I'm glad it is working now :) Thanks for all your help! [editline]4th March 2016[/editline] turned out I don't even need an entity, because of how darkrp is overwriting GM:PlayerSpawn(). I can just return nil, Vector() in PlayerSelectSpawn and everything works fine :)
Don't forget to close the topic ;)
Sorry, you need to Log In to post a reply to this thread.