kavaline Posted December 5, 2021 Share Posted December 5, 2021 Exists any ListenForEvent for inspects, specially inspecting players? If not, how to create one (or something like it)? Link to comment https://forums.kleientertainment.com/forums/topic/135873-trigger-a-function-on-inspect/ Share on other sites More sharing options...
CarlZalph Posted December 6, 2021 Share Posted December 6, 2021 @kavaline Inspecting anything, including players, happens in ACTIONS.LOOKAT and is piloted by the player's playercontroller component. What you want to do will most likely reside in either of those cases. Your use case will vary depending if you want to run things on the client versus server, and whether or not you want to interfere with it doing something or not. Link to comment https://forums.kleientertainment.com/forums/topic/135873-trigger-a-function-on-inspect/#findComment-1519266 Share on other sites More sharing options...
kavaline Posted December 6, 2021 Author Share Posted December 6, 2021 @CarlZalph My idea is, every time that my character inspects another player character, he will receive 1 sanity per inspection, as a test. It will be their power, so, have server commands, but that affects only that char. I need a trigger to him, was wondering if have some event called on inspecting, would solve my problem. I will read more about ACTIONS.LOOKAT to search something Link to comment https://forums.kleientertainment.com/forums/topic/135873-trigger-a-function-on-inspect/#findComment-1519273 Share on other sites More sharing options...
CarlZalph Posted December 6, 2021 Share Posted December 6, 2021 7 hours ago, kavaline said: My idea is, every time that my character inspects another player character, he will receive 1 sanity per inspection, as a test. It will be their power, so, have server commands, but that affects only that char. I need a trigger to him, was wondering if have some event called on inspecting, would solve my problem. I will read more about ACTIONS.LOOKAT to search something Ah, well that's easier to do since it's an after-the-fact thing. Hook ACTIONS.LOOKAT.fn and if the first return value is true, then you know it was successful. Then check `if act.target and act.target:HasTag("player") then` to do your stuff in the posthook area. You can read on how to function hook here: 1 1 Link to comment https://forums.kleientertainment.com/forums/topic/135873-trigger-a-function-on-inspect/#findComment-1519314 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now