Help with blocking areas of a map through ULX groups?
6 replies, posted
Heyo! So I'm at a point where I would like to make more donator exclusive content, and making a vip area seems quite fitting for that.
I am unsure of how to approach this because this is the first time I've done coding that relates to the map specifically... So, here I am looking for some pointers!
I feel like I need to get an invisible model that has disabled collisions, and block all but the donator ulx groups from interacting with it. Or is there some other way of doing it?
All help is appreciated! Thank you.
player:IsUserGroup("nameofulxgroup") can be used to check if someone is part of a group in ULX.
you can use the [URL="http://wiki.garrysmod.com/page/GM/ShouldCollide"]ShouldCollide[/URL] hook to force a collision with different entities.
What I would do is create a large invisible block around the place you are making VIP only, and set it to collide with the ulx groups you don't want in the zone.
That's what I had in mind, and thank you for showing me the hook! I will try using it, and see what I end up with.
[editline]19th November 2015[/editline]
[CODE]
local donator = LocalPlayer():IsUserGroup("donator")
if donator then
for _, ply in pairs( player.GetAll() ) do
-- Stuff!
end
end
[/CODE]
I'll try doing something like this, but with the hook. I will post my results. Once I get to it. ^^
I'm having trouble getting the door as a usable variable. I've played around but I can't quite get it... Anyone know how to do that? Basically getting a door on a map as a usable entity.
[QUOTE=Dan,;49145733]I'm having trouble getting the door as a usable variable. I've played around but I can't quite get it... Anyone know how to do that? Basically getting a door on a map as a usable entity.[/QUOTE]
Lookup "func_door*" and find the one that's closest to the door you want.
Thanks for replying Nak. On the map I am using, I used the following code to find the name of the door, or the entity details attached to it anyway.
[CODE]
hook.Add( "PlayerUse", "I'mAwesome", function( ply, ent )
print( ply, ent )
end)
[/CODE]
I plan on using the hook PlayerUse, since you need a door to access the donator area. Anyway, I used this and got the following results from that door.
[CODE]
Player [1][Dan] Entity [559][func_door]
[/CODE]
Just how do I get this as a variable though? ent:Entity( 559 )? Or something similar? Most things I try return as nil, so any help is really wonderful at this point, haha...
A friend of mine helped me out with this. The trick was to create a brush entity bounded by collisions through min and max vectors.
Sorry, you need to Log In to post a reply to this thread.