Need help with basic script

okay, so i’ve tried searching on youtube but I couldn’t really find anything
image
I’m trying to make it where if the username is = to a certaint thing then the gui is visible but i’m not sure what to do

1 Like

Try this:

if game.Players.LocalPlayer.Name == "R1S1NGS" then
      game.Players.LocalPlayer.ScreenGui.Frame.Visible = true
end
1 Like

Try this instead:

local player = game.Players.LocalPlayer
if player.Name == "yourname" then
      player.PlayerGui.ScreenGui.Frame.Visible = true
end

game.StarterGui just changes the gui on the Server Side, but you need to change the player’s PlayerGui. Also make sure it’s in a Local Script.

1 Like

still hasn’t worked <30chars> <30chars>

Are you getting an error? If so, what’s the error?

wait, I put the script into workspace, could that be why?

Can you show me the explorer where you put the script?

Yes, you need to put a LocalScript into StarterGui.

You need to put a local script in StarterGui.

okay i’m dumb thanks guys

1 Like

It’s fine, everyone starts somewhere!

1 Like

wait actually, it’s still not working
image
image

Are you sure you are using an account named “r1slngs”?

Make sure the name is spelled exactly like the actual name of the player. Including capital letters.

1 Like

Oh wait including caps, oh ok lol

okay yeah it worked, thanks a lot! :slight_smile:

1 Like