Jump to content

[SOLVED] Need help making character freeze forever without red screen


Recommended Posts

Hello, I have a question. So, when my character enters a mode called gelid mode I want the player's screen to get ice around it like this

a.jpg

The code I currently use to do this is this

act.target.components.temperature.maxtemp = -0
act.target.components.temperature.current = -0.1
act.target.components.temperature.mintemp = -0.15

but this also allows my character to get some ugly red thing around the screen which I don't want it looks like this

Blah.jpg

Is there a number I can make his temp lock to that only the ice will show for him or is there a way to make the red thing not come while his freezing in gelid mode? I would really appreciate some guidance from someone smart :D!!!! Thank you so much for reading :D:D:D:D!!!!

PS. If I add "act.target:AddTag("fridge")" to my character his inventory will act as a fridge, right?

Edited by SuperDavid
Link to comment
Share on other sites

character.lua

local function NoGelidFreezing(inst)
	inst.noactualfreezing = net_bool(inst.GUID, "player.noactualfreezing")
	inst.noactualfreezing:set(false)
	local _IsFreezing = inst.IsFreezing
	inst.IsFreezing = function(inst)
		if inst.noactualfreezing:value() then
			return false
		end
		return _IsFreezing(inst)
	end
end

local function common_postinit(inst)
	NoGelidFreezing(inst)
end

and now activate the net variable before changing the temperature

act.target.noactualfreezing:set(true)

act.target.components.temperature.maxtemp = -0
act.target.components.temperature.current = -0.1
act.target.components.temperature.mintemp = -0.15

so that when you freeze, you don't actually freeze.

Remember to set it to false when you exit gelid mode.

Link to comment
Share on other sites

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
 Share

×
  • Create New...