I'm making a Staff GUI and when I address a certain person(myself) to open the Staff GUI, out comes this:
if player.Name = "TheMightyHisez" then
the error code is on the =. it says Expected 'then' got '='
my whole code:
game.Players.PlayerAdded:Connect(function(player) if player.Name = "TheMightyHisez" then script.Parent.Parent.Parent.Visible = true end end)
--this is when you have to make the text go through the chat, also being invisible to other players aswell. HELP MEH
script.Parent.MouseButton1Down:Connect(function()
bc = BrickColor.new("Dark stone grey")
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = :fly player.Name; Font = Enum.Font.Cartoon; Color = bc.Color; FontSize = Enum.FontSize.Size96; Visible = false
})
end
end)
end
end
please help me
Use == for if and this isn't C# you don't put a ; at the end of every line. I don't even know what you are doing...
Hey,
if player.Name = "TheMightyHisez" then
should be
if player.Name == "TheMightyHisez" then
= is an Assignment Operator it is used to assign the value of variable or expression, while == is an Equal to Operator and it is a relation operator used for comparison
As for the rest of the code, its not properly formatted, so I won't be looking at it.
EDIT: Not too sure what you're trying to accomplish with using FireServer() from the server??
script.Parent.MouseButton1Down:Connect(function()
bc = BrickColor.new("Dark stone grey")
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = :fly player.Name; Font = Enum.Font.Cartoon; Color = bc.Color; FontSize = Enum.FontSize.Size96; Visible = false
})
end
end)
end
end
the format is here. Im just a starter in roblox studio. I combined AlvinBlox's tutorial on System Messages into this. This is probably completely utterly wrong.