Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a welcome GUI that only shows when an owner/co-owner joins?

So, I have followed a simple tutorial on how to make a gui that will appear for 3 seconds saying "(user) has joined the game!". But, I want this only to show when an owner/co-owner has joined. Their ranks are 254, and 255 in my group. The gui itself works perfectly fine, and I have a basic knowledge of scripting. But currently it says every user who joins. Which is obviously not what I need.

**Script: ** game.Players.PlayerAdded:Connect(function(player) local RE = game.ReplicatedStorage:WaitForChild("RemoteEvent") RE:FireAllClients(player.Name) end)

Local Script: *game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(text) script.Parent.TextButton.Text = text .. " has joined the game!" script.Parent.TextButton.BackgroundTransparency = 0.7 script.Parent.TextButton.TextTransparency = 0 wait(3) script.Parent.TextButton.Text = "" script.Parent.TextButton.BackgroundTransparency = 1 script.Parent.TextButton.TextTransparency = 1 end) *

1 answer

You could simply fix this by saying in the server script

local Players = game:GetService("Players")

local groupID = 1

Players.PlayerAdded:Connect(function(player)
	local Rank = player:GetRankInGroup(groupID)
	if Rank == 254 or Rank == 255 then
		-- Fire your remote event
	end
end)

1 comment

0

Got it to work! Thanks.

This discussion is preserved as it was. New answers, comments, and votes are closed.