• PlayerNoClip Dosn't work?
    4 replies, posted
Ok so i need to block noclip for a few players on a server. So using the "PlayerNoClip" hook i return false. But for some reason the players can still noclip. I have tested the hook and it is being called and it is returning false. So why does this hook no longer work properly, I mean it used to work. Test i tryed: [lua] local function Test( Player ) print( Player:Name() .. " Tried to noclip" ) return false end hook.Add("PlayerNoClip","PlayerNoClip_Test",Test) [/lua] [b][url=wiki.garrysmod.com/?title=Gamemode.PlayerNoClip]Gamemode.PlayerNoClip [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
Never mind. I got confused and I'm tired >.<
[QUOTE=Jova;23268107]Never mind. I got confused and I'm tired >.<[/QUOTE] Err wut?
[lua] function GM:PlayerNoClip( pl ) local oldstate = pl:GetMoveType() if oldstate != MOVETYPE_NOCLIP then if CLIENT and IsFirstTimePredicted() then pl:PrintMessage(HUD_PRINTTALK, "You can't turn into a ghost!") end return false end return true end [/lua] Try the example on the wiki
[lua] function GM:PlayerNoClip(Player) return Player:IsSuperAdmin() end [/lua]
Sorry, you need to Log In to post a reply to this thread.