Jump to content

Recommended Posts

So sorry for making 3 topic in a row...but I have no choice but to ask for help since i'm dumb :wilson_facepalm:.........

What I need to ask is, is it possible to make character's speech go away with some code?

I know there's " act.target.components.talker:ShutUp() " but that only makes them stop talking not get rid of the speech thing, is there a way to get rid of the text too? Thanks you so much for reading my question, god bless you all :D!!!

 

Edited by SuperDavid
2 hours ago, Aquaterion said:

if you mean the text, have you tried forcing the character to say nothing(empty line)

Yes that's what I mean & yes I tried but making them say 

act.target.components.talker:Say("")

but nothing happened :?..

local function CanGoMute(inst)
	inst.cantspeak = net_bool(inst.GUID, "player.cantspeak")
	inst.cantspeak:set(false)

	local _Say = inst.components.talker.Say
	inst.components.talker.Say = function(self, ...)
		if self.inst.cantspeak:value() then
			return
		end
		return _Say(self, ...)
	end
end

local function common_postinit(inst)
	CanGoMute(inst)
end

Now do

inst.cantspeak:set(true)

to mute your character.

Back to false again to let it speak.

Thanks DarkXero :D!! The thing is that code makes my character not be able to talk.. I just want the text my character says to go away when a code activates but that's probably not possible so it's okay & thank you :).

36 minutes ago, SuperDavid said:

The thing is that code makes my character not be able to talk.. I just want the text my character says to go away when a code activates but that's probably not possible

Well I thought watching Wilson talk and say nothing was weird.

local function CanGoMute(inst)
	inst.cantspeak = net_bool(inst.GUID, "player.cantspeak")
	inst.cantspeak:set(false)

	inst.components.talker.mod_str_fn = function(message)
		if inst.cantspeak:value() then
			return ""
		end
	end
end

local function common_postinit(inst)
	CanGoMute(inst)
end

But that should do it.

On 9/7/2016 at 1:11 AM, DarkXero said:
local function CanGoMute(inst)
	inst.cantspeak = net_bool(inst.GUID, "player.cantspeak")
	inst.cantspeak:set(false)

	local _Say = inst.components.talker.Say
	inst.components.talker.Say = function(self, ...)
		if self.inst.cantspeak:value() then
			return
		end
		return _Say(self, ...)
	end
end

local function common_postinit(inst)
	CanGoMute(inst)
end

Now do

inst.cantspeak:set(true)

to mute your character.

Back to false again to let it speak.

Quick question, where do me put this? (´・ω・`)

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...