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

What did I do wrong? I searched everything up on roblox wiki but it still doesn't work?

Script :

---VAIRBLES---
local Players = game:GetService("Players")
local text = script.Parent.Text

---FUNCTION---
function onPlayerEntered(player)
text = ("Y")
wait (.1)
text = ("YO")
wait (.1)
text = ("YOU")
wait (.1)
text = ("YOU A")
wait (.1)
text = ("YOU AR")
wait (.1)
text = ("YOU ARE")
end

game.Players.PlayerAdded:connect(onPlayerEntered)

1 comment

0

What comes out in the output?

2 answers

This should be a LocalScript. If you're using a normal server script, this will not work. Also, there's a more efficient way of getting the text to have a "typing" effect.

LocalScript inside a Gui.

local Players = game:GetService('Players')
local Label = script.Parent
local String = 'YOU ARE A PERSON'

Players.PlayerAdded:Connect(function(player)
	for i = 1,#String do --This makes the typing effect.
		Label.Text = String:sub(1,i)
		wait(.02) --You can change this. The lower, the faster.
	end
end)

1 comment

0

That looks perfect, I put a LocalScript inside a TextLabel, but it still doesn't work...?

Hey, here's a fixed version of the script from above.

local Players = game:GetService('Players')
local Label = script.Parent
local String = 'YOU ARE A PERSON'

Players.PlayerAdded:Connect(function(player)
    for i = 1, string.len(String) do --This makes the typing effect.
        Label.Text = string.sub(String, 1, i)
        wait(.02) --You can change this. The lower, the faster.
    end
end)

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