I looked all over youtube and all the videos are over a year old and none of them work either. Please help!
Handle the GUI giving on server side, and only give it to certain players.
Dont use the StarterGui service to place the GUI, keep it on ServerStorage, and by using a server side script clone it from there and give it to the specific players you want them to have it
Can you give an example? That didn’t make sense
Have the gui in server storage.
When player joins check if their name is on list then clone the ui and put it in their playergui.
local ui = game:GetService("ServerStorage"):WaitForChild("UI")
local plrs = game:GetService("Players")
plrs.PlayerAdded:Connect(function(plr)
if table.find(list, plr.Name) then
ui:Clone().Parent = plr:WaitForChild("PlayerGui")
end
end)
Still not working and “list” is marked as error. Also where do I imput the players name
The list is supposed to be a table of the authorized player names that see the gui.
aka, {“ortacise”, “BearQTS”}
yeah but where do I put the names for the table
Why that didnt make sense?
@ortacise already provided an example of the approach I mentioned.
Dont use names, use the IDs
local list = {1234156156, 123546516, 156416546}
still doesn’t work, is the script supposed to be local? Is the script supposed to be in server storage, either in the screengui or out of it?
Should be a server script in ServerScriptService, the GUI should be in ServerStorage
local ui = game:GetService("ServerStorage"):WaitForChild("UI")
local plrs = game:GetService("Players")
local list = {1234156156, 123546516, 156416546}
plrs.PlayerAdded:Connect(function(plr)
if table.find(list, plr.UserId) then
ui:Clone().Parent = plr:WaitForChild("PlayerGui")
end
end)
Yeah, but you are not referencing your Gui
local ui = game:GetService("ServerStorage"):WaitForChild("OutStageControls") -- here
local plrs = game:GetService("Players")
local list = {1234156156, 123546516, 156416546}
plrs.PlayerAdded:Connect(function(plr)
if table.find(list, plr.UserId) then
ui:Clone().Parent = plr:WaitForChild("PlayerGui")
end
end)
Ohhhhh! That worked, thanks. I thought that “UI” was refering to StarterGUI, telling it to copy to there
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.