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

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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)
0
Got it to work! Thanks. tvx_ler 0 — 3y
Ad

Answer this question