Hi, I went on the gmod lua wiki and discovered a few new vehicle-related functions.
Update: Solved, I can just do:**
lua_run hook.Add( "PlayerEnteredVehicle", "Myhook", function( ply, veh, role ) print(veh:GetModel()) end )
or use Vehicle:GetClass()
Let me just jump right into it, I’m using console to test.
So if I enter a vehicle and do
my console prints Vehicle [prop_vehicle_prisoner_pod]
So then I try to find the correct way to check this and have it return a boolean value.
lua_run if (Entity(1):GetVehicle() == "Vehicle [prop_vehicle_prisoner_pod]" ) then print( "true" ) else print ( "false" ) end
Yet my console prints false.
Basically, on GM:PlayerEnteredVehicle (called whenever a player enters a vehicle) I just want a way to check if the vehicle they entered was a pod.
That’s my end goal.