Mario384 Posted May 29, 2016 Share Posted May 29, 2016 (edited) Currently, this statement is attached to inst.OnSave, however if a player leaves (which is an event that saves them) it doesn't apply to them. function onpossesssave(inst) if inst:HasTag("possessedmob") then inst:AddTag("playerghost") inst.Network:AddUserFlag(USERFLAGS.IS_GHOST) inst.player_classified:SetGhostMode(true) inst:PushEvent("ms_becameghost") end end I've also tried doing a negative health delta, but the character will simply rejoin with full hp instead. Is there some day to ensure if a player had a certain tag when they left they would be killed when they rejoin? Edited May 29, 2016 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/ Share on other sites More sharing options...
DarkXero Posted May 29, 2016 Share Posted May 29, 2016 I don't get it. Why not just kill them when they rejoin? Attach to OnLoad the same check for the "possessedmob" tag and then kill them. Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777632 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 (edited) 12 hours ago, DarkXero said: I don't get it. Why not just kill them when they rejoin? Attach to OnLoad the same check for the "possessedmob" tag and then kill them. The tag doesn't add itself when they rejoin. Mind you, these are regular players. Actually, here, just take a look: Possession Mod.zip Edited May 29, 2016 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777786 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 (edited) 2 hours ago, Mario384 said: The tag doesn't add itself when they rejoin. Mind you, these are regular players. Actually, here, just take a look: Possession Mod.zip if you just want the tag to be there on load, then add an OnSave and OnLoad function with something like local function OnSave(inst, data) data.possessed = inst:HasTag("possessed") end local function OnLoad(inst, data) if data and data.possessed then inst:AddTag("possessed") end end Edited May 29, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777806 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 (edited) 47 minutes ago, Aquaterion said: if you just want the tag to be there on load, then add an OnSave and OnLoad function with something like local function OnSave(inst, data) data.possessed = inst:HasTag("possessed") end local function OnLoad(inst, data) if data and data.possessed then inst:AddTag("possessed") end end Alas, I can't because data is not declared. Not sure why though. Edited May 29, 2016 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777824 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 did u do inst.OnSave = OnSave inst.OnLoad = OnLoad in ur prefab? Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777826 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 2 minutes ago, Aquaterion said: did u do inst.OnSave = OnSave inst.OnLoad = OnLoad in ur prefab? Yes. Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777829 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 (edited) try local function OnSave(inst) return {possessed = inst:HasTag("possessed")} end Edited May 29, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777835 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 (edited) 53 minutes ago, Aquaterion said: try local function OnSave(inst) return {possessed = inst:HasTag("possessed")} end I tried this, and then tried different version of this, but nothing worked. EDIT: Wait a second. EDIT 2: Nope, doesn't work. Edited May 29, 2016 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777852 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 hmm.. where exactly are u putting this? Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777854 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 Possession Mod.zip Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777857 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 I think you should put the save on the main function, not on the possessing function Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777859 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 55 minutes ago, Aquaterion said: I think you should put the save on the main function, not on the possessing function I just tried that, also didn't work. Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777883 Share on other sites More sharing options...
DarkXero Posted May 29, 2016 Share Posted May 29, 2016 OnSave for entities doesn't return a table, it gets passed the table to use. local function OnSave(inst, data) data.possessedmob = inst:HasTag("possessedmob") end Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777893 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 4 minutes ago, DarkXero said: OnSave for entities doesn't return a table, it gets passed the table to use. local function OnSave(inst, data) data.possessedmob = inst:HasTag("possessedmob") end tried that already, but apparently didnt work, but i guess he didn't try it in the main fn yet Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777897 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 Also, why would putting it in the main function help any? It's not supposed to affect the spiderden, it's supposed to affect the player. Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777898 Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 2 minutes ago, Mario384 said: Also, why would putting it in the main function help any? It's not supposed to affect the spiderden, it's supposed to affect the player. well you tried to put it in a function that only runs when you haunt it, is this suppose to be able to happen to all characters? or just a specific character? either way I think it would be more ideal to do this via component. Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777899 Share on other sites More sharing options...
Mario384 Posted May 29, 2016 Author Share Posted May 29, 2016 (edited) Okay, here's the idea: Any player dies, haunts Spider Den, becomes spider. New day begins, possessed spiders die. Player who is a possessed spider leaves and rejoins, die on rejoin. First 2 work, last one doesn't. Edited May 29, 2016 by Mario384 Link to comment https://forums.kleientertainment.com/forums/topic/67723-trying-to-make-player-ghost-if-they-leave-and-rejoin/#findComment-777902 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