Mockup script to allow noclip in the air but not through anything else.

Has anyone got a adding that will allow all players accept admins to noclip only in air and not through npcs, props, Walls, doors and anything else.

Thanks.

[lua]MOVETYPE_FLY[/lua]
and
**[Entity.SetMoveType

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.SetMoveType)**

Well can I have a script for that.

It is the request section after all.

[lua]hook.Add(“PlayerSpawn”,“fly”, function(ply)
if not ply:IsAdmin() then
ply:SetMoveType(MOVETYPE_FLY)
end
end)[/lua]

Wont that do it when a player spawns?

I need it to replace noclip.

[lua]function Fly( ply )
if !ply:IsAdmin() then
ply:SetMoveType(MOVETYPE_FLY)
else
ply:SetMoveType(MOVETYPE_NOCLIP)
end
end
hook.Add(“PlayerNoClip”, “FlyHigh”, Fly)[/lua]

ok, and that goes into client autorun?

Server .lua file

It’s not working for me, i tried throwing it in autorun/server/ but nothing happens, wtf am i doing wrong?

[lua]
hook.Add(“PlayerNoClip”,0,function§

if p:IsAdmin() then return true end

p:SetMoveType(MOVETYPE_FLY)
return false

end)
[/lua]

I put your code in a file, noclip_block.lua, in garrysmod/lua/autorun/server/ but i can still noclip through everything.

because your admin :stuck_out_tongue:

Of course I already commented out that one admin-check part, so it “should” work for everyone but it doesn’t

[lua]hook.Add(“PlayerNoClip”,0,function§
– if p:IsAdmin() then return true end
p:SetMoveType(MOVETYPE_FLY)
return false
end)[/lua]

What the fuck is that 0 doing after the hook name.

It’s the unique name:v:

Oh lord. Are people really that lazy nowadays…

[editline]19th October 2010[/editline]

Oh wait, are you really that lazy :v:

Do you really expect me to have the patience to write TWO quotation marks?!:saddowns:

I can see why you wouldn’t.

http://www.facepunch.com/fp/avatar.png

waves script is still not working, justin won’t help here :<

ever heared of Uclip? might want to look into the code