Need help removing flash bang effect from gui text

My goal is to make the text not transparent and then transparent again, which I did.


However as you can see, the text has a flashbang effect which isn’t very nice.
Here is the script:

	
	while guideTxt.TextTransparency > 0 do
		wait(0.01)
		guideTxt.TextTransparency -= 0.02
	end
	
	wait(5)
	while guideTxt.TextTransparency < 1 do
		wait(0.01)
		guideTxt.TextTransparency += 0.02
	end
end

I tried changing stroke transparency, but it only delays the flashbang instead of making a smooth transition:

	
	while guideTxt.TextTransparency > 0 do
		wait(0.01)
		guideTxt.TextTransparency -= 0.02
		guideTxt.TextStrokeTransparency -= 0.02
	end
	
	wait(5)
	while guideTxt.TextTransparency < 1 do
		wait(0.01)
		guideTxt.TextTransparency += 0.02
		guideTxt.TextStrokeTransparency += 0.02
	end
end

I think this works:

local function adjustForFlashBang(guiText)
	guiText.TextTransparency = 0
	while guiText.TextTransparency < 1 do
		guiText.TextTransparency = guiText.TextTransparency + 0.02
		wait()
	end
end

 adjustForFlashBang(guiText)



local function adjustForFlashBang(guiText)
	guiText.TextTransparency = 0
	while guiText.TextTransparency < 1 do
		guiText.TextTransparency = guiText.TextTransparency + 0.02
		wait()
	end
end

adjustForFlashBang(guiText)

It is causing a lot of mess in my code when I try to impliment it in the script.

Oh sorry, I tried helping but maybe try to clear the script and then insert the script?

I did, but there are syntax errors everywhere (even when renaming guitext to guidetxt), and the numbers are wrong. I also fail to see how this solves my original problem…

Aight, sorry there. I tried to help but I cannot do more than that right now in GUI’s and things, I am not really experienced in GUI’s right now.

local TS = game:GetService("TweenService")

TextLabel.TextColor3 = Color3.fromRGB(190,190,190) -- Darkens the Text

for i = 1,3 do -- Repeats 3 times
TS:Create(TextLabel, TweenInfo.new(2), {TextTransparency = 0})
task.wait(2)
TS:Create(TextLabel, TweenInfo.new(2), {TextTransparency = 1})
task.wait(2)
end

This doesn’t trigger it. Did I do something wrong?

local TS = game:GetService("TweenService")

	for i = 1,3 do -- Repeats 3 times
		TS:Create(guideTxt, TweenInfo.new(2), {TextTransparency = 0})
		task.wait(2)
		TS:Create(guideTxt, TweenInfo.new(2), {TextTransparency = 1})
		task.wait(2)
	end

sorry, add :Play()

local TS = game:GetService("TweenService")

TextLabel.TextColor3 = Color3.fromRGB(190,190,190) -- Darkens the Text

for i = 1,3 do -- Repeats 3 times
TS:Create(TextLabel, TweenInfo.new(2), {TextTransparency = 0}):Play()
task.wait(2)
TS:Create(TextLabel, TweenInfo.new(2), {TextTransparency = 1}):Play()
task.wait(2)
end

Its just an effect, you can remove it

Now it’s missing the textStroke.

local TS = game:GetService("TweenService")

TextLabel.TextColor3 = Color3.fromRGB(190,190,190)

for i = 1,3 do
TS:Create(TextLabel, TweenInfo.new(2), {TextTransparency = 0, TextStrokeTransparency = 0}):Play()
task.wait(2)
TS:Create(TextLabel, TweenInfo.new(2), {TextTransparency = 1, TextStrokeTransparency = 1}):Play()
task.wait(2)
end

1 Like

Unfortunately this brings me back to my original problem, which is the flashbang effect.

This line is meant to prevent the text from being very bright

The text itself was never bright to begin with. The problem is that my textstroke is causing this weird effect as you can see in the video I posted.

  1. The stroke is covering the entire txt, instead of only the edges.
  2. The stroke is instantly turning 100% non transparent.

The tween service is cool though, even though it doesn’t solve it.

This is what the Script should do:


it shouldn’t cause a “Flashbang” effect

It gives the same effect that my original script gives.
And yes I know it shouldn’t cause a flashbang effect - that is why I am posting on DevForum.

But why are you arguing then???

I’m not arguing. I am simply explaining that the problem is displayed on the original video that I posted. The stroke is behaving weirdly.

Can you show your whole script then? there may be something interfering with it


-- variables

local camCheck = false

local cc = workspace.CurrentCamera

local plr = game.Players.LocalPlayer.Character

local mc = workspace.menuCam

local playB = game.Players.LocalPlayer.PlayerGui.Menu.playB

local settingsB = game.Players.LocalPlayer.PlayerGui.Menu.settingsB

cc.CameraType = Enum.CameraType.Scriptable

cc.CFrame = mc.CFrame

-- functions

local function playClick()
	
	local startVol = game.SoundService.menuMusic.Volume
	
	local darken = script.Parent.Parent.Parent.darkener.darken
	
	game.Players.LocalPlayer.PlayerGui.Menu.Enabled = false
	
	local userInputService = game:GetService("UserInputService")
	
	local guideTxt = game.Players.LocalPlayer.PlayerGui.guide1.text

	userInputService.MouseIconEnabled = false
	
	while darken.Transparency >= 0 do
		wait(0.01)
		darken.Transparency -= 0.02
		game.SoundService.menuMusic.Volume -= (startVol/100)*2
	end
	
	--gameplay settings
	plr.Humanoid:RemoveAccessories()
	game.Lighting.Atmosphere.Density = 0.9
	game.Lighting.Brightness = 0.5
	plr:MoveTo(workspace.startBlock.Position)
	camCheck = true
	wait(0.1)
	game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
	wait(0.5)
	game.SoundService.wind.Playing = true
	
	--enable scripts
	game.Players.LocalPlayer.PlayerScripts.ambience1.Disabled = false
	game.Players.LocalPlayer.PlayerScripts.ambience2.Disabled = false
	game.Players.LocalPlayer.PlayerScripts.ambience3.Disabled = false
	game.Players.LocalPlayer.PlayerScripts.ambience4.Disabled = false
	game.Players.LocalPlayer.PlayerScripts.flashlight.Disabled = false
	game.Players.LocalPlayer.PlayerScripts.walkSounds.Disabled = false
	game.Players.LocalPlayer.PlayerScripts.sprint.Disabled = false
	
	while darken.Transparency <= 1 do
		wait(0.01)
		darken.Transparency += 0.02
	end	
	
	
	local TS = game:GetService("TweenService")

	TS:Create(guideTxt, TweenInfo.new(2), {TextTransparency = 0, TextStrokeTransparency = 0}):Play()
		task.wait(5)
	TS:Create(guideTxt, TweenInfo.new(2), {TextTransparency = 1, TextStrokeTransparency = 1}):Play()
	end

--	while guideTxt.TextTransparency > 0 do
--		wait(0.01)
--		guideTxt.TextTransparency -= 0.02
--		guideTxt.TextStrokeTransparency -= 0.02
--	end
	
--	wait(5)
--	while guideTxt.TextTransparency < 1 do
--		wait(0.01)
--		guideTxt.TextTransparency += 0.02
--		guideTxt.TextStrokeTransparency += 0.02


playB.MouseButton1Click:Connect(playClick)