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

GUI for me and a few people not working. How can I fix it?

Asked by 5 years ago

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 is much appreciated, I've been trying to figure this out for an hour, but I haven't been able to.

1 answer

Log in to vote
0
Answered by 5 years ago

You could change the first line to look like this:

if game.Players.LocalPlayer == "ThrashIsDead" or "poophead27272" or "darkslayer741" then

Also, it looks like you forgot to put "end". You should also make sure this is in a local script, and not a regular script, because only local scripts can find a local player.

0
Thank you for this, however it still shows up for people that are not on the list. If you have a different fix it is much appreciated. ThrashIsDead 4 — 5y
Ad

Answer this question