Jump to content

Recommended Posts

  My mod creates hallucinations of mobs, what dissappear in 10 secs. But if you save-load the hallucinations turn in to normal mobs.

  How to delete mobs on load/save in a right way?

 

I treid this but for some reason it doesn't work

 

 

 

local function onsave(inst, data)
if inst.removeOnLoad then
data.removeOnLoad = true
end
end

local function onload(inst, data)
if data and data.removeOnLoad then
inst:Remove()
end
end

local function reoveonload(inst)  
inst.OnSave = onsave
inst.On

 

 

......................................

MakeHallunfn(count,day,self)

.......................

  data.removeOnLoad == true 

   reoveonload(inst) 
.................................

end

 

 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...