I’m an Builder, so scripting isn’t really my thing. I just need help with this.
let’s say I join my game, I want an GUI appear only on my screen when I join.
You could have a script in ServerScriptService
with a screengui under it
local gui = path.to.gui -- replace with path to gui
local whoToGive = {
1234567890 -- put userids here
}
game:GetService("Players").PlayerAdded:Connect(function(player)
if table.find(whoToGive, player.UserId) then
gui:Clone().Parent = player:WaitForChild("PlayerGui")
end
end)
About this, what does path mean?
like… again, I’m not that smart in programming.
If the gui’s name is OwnerGui and it is located under the script, just use script.OwnerGui
It’s where you locate the objects with .
Assuming you want it to appear every time a player joins (despite it being the same player),
Select your GUI, scroll down and unselect ResetOnSpawn, it’s the simplest way I can think of.
Add a localscript under the GUI:
local timeAppearing = 8
repeat wait() until game:IsLoaded() wait(1)
wait(timeAppearing)
script.Parent.Enabled = false
There are other ways to achieve the same thing, but this way’s the simplest (to my knowledge).
P.S The GUI must be inside if StarterGui already
Like this?
local gui = script – replace with path to gui
local whoToGive = {
1884221943 – put userids here
}
game:GetService(“Players”).PlayerAdded:Connect(function(player)
if table.find(whoToGive, player.UserId) then
gui:Clone().Parent = player:WaitForChild(“PlayerGui”)
end
end)
It should be the gui, not the script
This is the screenshot:
local gui = script – replace with path to gui
local whoToGive = {
1884221943 – put userids here
}
game:GetService(“Players”).PlayerAdded:Connect(function(player)
if table.find(whoToGive, player.UserId) then
gui:Clone().Parent = player:WaitForChild(“PlayerGui”)
end
end)
I should change it to Admin?
@myaltaccountsthis
Change it to script.ScreenGui