I'm trying to make a roblox gui only visible to me and a few friends, however the first comma in the script has an error. The error says "Expected 'then' when parsing if statement, got ',' .
Here is the Code:
if game.Players.LocalPlayer == {"ThrashIsDead","poophead27272","darkslayer741"} then script.Parent.Visible = true else script.Parent.Visible = false
Help would be greatly appreciated. I've been struggling with this for some time now, but can't seem to figure it out.
You're comparing an instance with a table. Here, use table.find
:
local Table_Of_Names = {"ThrashIsDead","poophead27272","darkslayer741"}; if table.find(Table_Of_Names,game:service'Players'.LocalPlayer.Name)then print'Oh wow' end;
You're using squiggly brackets like it's a table. Also you're comparing string to an object value. Idk if using 'or' or a comma makes a difference though.
script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer.Name == ("Edbotikx" or "poophead27272" or "darkslayer741") then script.Parent.Visible = true print"visible" else script.Parent.Visible = false print"not" end end)