Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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.

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. Mrawzomeperson -3 — 4y
0
Do you think it's the type of script I'm using? Should I be using a LocalScript or a Script? PumpyTooClouted 4 — 4y
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). Erie20 102 — 4y
0
yes PumpyTooClouted 4 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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
Ad

Answer this question