Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

text label not changing?

Ive tried doing the text label effect the regular way but it wasnt work, so i changed to this, the text label still wont change though no errors;

local plr = game.Players.LocalPlayer
if workspace.IntroductionValue.Value == 1 then
	print("(????)")
	script.Parent.TextStrokeTransparency = 0
	wait(0.1)
	script.Parent.Text = "H"
	wait(0.5)
	script.Parent.Text = "Hu"
	wait(0.5)
	script.Parent.Text = "Huh"
	wait(0.5)
	script.Parent.Text = "Huh."
	wait(0.5)
	script.Parent.Text = "Huh.."
	wait(0.5)
	script.Parent.Text = "Huh..?"
	wait(3)
	wait(0.5)
	script.Parent.Text = " "
	wait(0.5)
	script.Parent.Text = "W"
	wait(0.5)
	script.Parent.Text = "Wh"
	wait(0.5)
	script.Parent.Text = "Whe"
	wait(0.5)
	script.Parent.Text = "Wher"
	wait(0.5)
	script.Parent.Text = "Where"
	wait(0.5)
	script.Parent.Text = "Where "
	wait(0.5)
	script.Parent.Text = "Where a"
	wait(0.5)
	script.Parent.Text = "Where am"
	wait(0.5)
	script.Parent.Text = "Where am "
	wait(0.5)
	script.Parent.Text = "Where am I"
	wait(0.5)
	script.Parent.Text = "Where am I?"











	
	
end

2 answers

✓ Accepted answer

There is nothing activating the function.

Do the following. Create something that activates the function, such as a remoteEvent that, when triggered, does this.

So... Let's assume that the dialogue starts when the player touches a piece

To activate this RemoteEvent on the specific client, do the following.

local Debounce = false -- Is a lock.

script.Parent.Touched:Connect(function(Hit)
	if Debounce == false then
		Debounce = true

		local Character = Hit.Parent
		local Player = game.Players:GetPlayerFromCharacter(Character)
		if Player then
			script.Parent.RemoteEvent:FireClient(Player)
		end
		
	end
end)

In the LocalScript.

local DialoguePart = workspace:WaitForChild("DialoguePart")
local RemoteEvent = DialoguePart:WaitForChild("RemoteEvent")

RemoteEvent.OnClientEvent:Connect(function(Player)
	-- Your Code here. To make changes to the text.
end)

Hope this helps

Any questions, you can ask me

:)

1 comment

0

Bruh

Try seeing if it's because you're using an if statement when you should have something that checks more often (if statements only run once)

Try:

local plr = game.Players.LocalPlayer

workspace.IntroductionValue:GetPropertyChangedSignal("Value"):Connect(function()
	if workspace.IntroductionValue.Value == 1 then
		print("(????)")
		script.Parent.TextStrokeTransparency = 0
		wait(0.1)
		script.Parent.Text = "H"
		wait(0.5)
		script.Parent.Text = "Hu"
		wait(0.5)
		script.Parent.Text = "Huh"
		wait(0.5)
		script.Parent.Text = "Huh."
		wait(0.5)
		script.Parent.Text = "Huh.."
		wait(0.5)
		script.Parent.Text = "Huh..?"
		wait(3)
		wait(0.5)
		script.Parent.Text = " "
		wait(0.5)
		script.Parent.Text = "W"
		wait(0.5)
		script.Parent.Text = "Wh"
		wait(0.5)
		script.Parent.Text = "Whe"
		wait(0.5)
		script.Parent.Text = "Wher"
		wait(0.5)
		script.Parent.Text = "Where"
		wait(0.5)
		script.Parent.Text = "Where "
		wait(0.5)
		script.Parent.Text = "Where a"
		wait(0.5)
		script.Parent.Text = "Where am"
		wait(0.5)
		script.Parent.Text = "Where am "
		wait(0.5)
		script.Parent.Text = "Where am I"
		wait(0.5)
		script.Parent.Text = "Where am I?"
	end
end)

2 comments

0

Use a for loop my guy.

0

It's good practice to use events instead of infinite loops. Having code run unnecessarily is... well unnecessary.

This discussion is preserved as it was. New answers, comments, and votes are closed.