cool_people = {id1,id2}
game.Players.PlayerAdded:Connect(function(Player)
if table.find(cool_people, Player.UserId) then
script.Parent.Visible = true
else
script.Parent.Visible = false
end
end)
Is supposed to make the button visible if the user ID is equal to any of the 2 id’s. It does not show any error messages and it does not show up. I have no idea why this is happening.
so here’s the issue, you have parented the server script to an UI. server scripts won’t work if you parent it to an UI, you this scripts instead
Server Script
local Cool_Players = {}
local RemoteEvent = --A remote event
game.Players.PlayerAdded:Connect(function(Plr)
if table.find(Cool_Players, Plr.UserId) then
RemoteEvent:FireClint(Plr, "Is A Cool Player")
end
end)
Clint Script
local RemoteEvent = --A remote event
RemoteEvent.OnClintEvent:Connect(function(v1)
if v1 == "Is A Cool Player" then
script.Parent.Visible = true
end
end)
I haven’t tested the script, so there might be some errors, if you won’t get the fix, put it here and ill help you out
10:12:11.775 OnClintEvent is not a valid member of RemoteEvent “ReplicatedFirst.cool_admin_guy” - Server - admin id:3
There is also a red underline on Cool_Players for “Unknown Global Cool_Players” on the same script.
I placed the client script in the same place and the server script in the ss service and also made a remote event and placed it on the dedicated places.
I made a mistake, which is creating that red underline, you can copy past the script now from here, forgot to remote a part code last time. The code is fine now.
Still does not work, this time no errors. These are the modifications I made:
Client script
local RemoteEvent = game.ReplicatedFirst.cool_admin_guy
RemoteEvent.OnClientEvent:Connect(function(v1)
if v1 == "Is A Cool Player" then
script.Parent.Visible = true
end
end)
Server script
local Cool_Players = {id,id}
local RemoteEvent = game.ReplicatedFirst.cool_admin_guy
game.Players.PlayerAdded:Connect(function(Plr)
if table.find(Cool_Players, Plr.UserId) then
RemoteEvent:FireClient(Plr, "Is A Cool Player")
end
end)
I have to go now, I’'ll be back later in an hour or 2.
Parent this script to ServerScriptService (Remove your older scripts too). Next up put the Admin UI button inside the script. and it should work.
local cool_people = {id1,id2}
game.Players.PlayerAdded:Connect(function(Player)
if table.find(cool_people, Player.UserId) then
script["Admin UI"].Parent = Player.PlayerGui.Menu.menu
end
end)