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

I'm having trouble with this script in the TextLabel. What did I do wrong in this script?

Hello. I'm pretty new to scripting, and I would like to know what I did wrong in this script. Here's the script:

local Status = script.Parent
local User1 = "PumpyTooClouted"
local User2 = "PraddaYou"

game.Players.PlayerAdded:Connect(function(Player)
	if Player.Name == User1 or Player.Name == User2 then
		wait()
		Status.Text = "Owner"	
	end
end)

Thanks for reading, lol.

4 comments

0

I don't know but maybe you have to type game.Players.LocalPlayer.Character == User1 instead of Player.Name == User1, but I don't know.

0

Do you think it's the type of script I'm using? Should I be using a LocalScript or a Script?

0

are you trying to make it so that the words show up like the username which appears in the workspace or like something on screen? U will need to use billboard gui for something that can be seen in the workspace (pretty sure u know that if not thats fine).

0

yes

1 answer

This works if you put in in statergui with a local script.

A bit complicated, but it will be better in the long run, as instead of having to change the 'if' statement, you just have to add to the users list.

If it worked, please accept this as the answer, or don't if someone had a better answer.

local Status = script.Parent
local Users = {"Quantrium","Tree"}

while wait(1) do	
				
for i, v in pairs(Users) do
		
		if v == game.Players.LocalPlayer.Name then
		
		print("this")
		script.Parent.Text = "tea"
		
		end
		
end

if script.Parent.Text == "tea" then
	
	break
	
end

end

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