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

How do i let a user see a GUI if the players name is the name of a value in serverstorage?

Asked by 6 years ago

Here is my code so far:

local playerswithpass = game.ServerStorage.Allowed:GetChildren()
repeat wait() 
until game.Players.LocalPlayer 

Player = script.Parent.Parent.Parent
Gui = Player.PlayerGui.GUI

for i = 1, #playerswithpass do
    local allplayers = (playerswithpass[i].Name)
    print(allplayers)
    if Player.Character == (allplayers) then
    Gui.Enabled = true
    else
    Gui.Enabled = false
end
end

0
Not sure what you mean PreciseLogic 271 — 6y
0
when defining player, use LocalPlayer because I assume this is a LocalScript since you use it on line 3. R_alatch 394 — 6y

Answer this question