LUA Help. Modifying.

So im editing the DarkRP Keys, basically i have this other bit of code which opens a menu, how would i check if a player is not looking at a car or door so the Primary and Secondary attack functions can change. So if a player is looking at a door they can lock it and unlock it, if they are looking at anything but a door they can open a menu. Thanks.

[editline]31st March 2016[/editline]

I forgot to add, currently the menu does open just overrides the default Primary Attack etc.

FYI: we cant do much if we have no code to work with. So add code for your keys (encase there slightly diff to latest drp one, and also give the new menu you want’s code)

You could check based on the trace entity class. If it contains “vehicle”, it’s a car, if it’s “prop_door_rotating” it’s a door, else open up the menu.

I can’t post the menu code simply because its off Scriptfodder.

there are more door classes than that so use Entity:isDoor

[editline]31st March 2016[/editline]

then post a link for it please :slight_smile:

https://scriptfodder.com/scripts/view/54