I am looking for a method to disable the player list GUI at certain times, or more precise, not beeing able to open it when certain GUIs are opened.
For example, when you open a shop, you cannot open the player list anymore, but as soon as you close that gui you can open the playerlist again.
I hope you understand what I meant. So I’ve heard of this:
Game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false), but that disables the playerlist for all right?
And then I tried this:
localPlayer.PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
But that doesnt work either, I get an error, is not valid bla bla bla.
So is there any way to make the playerlist not open for a certain period of time for ONLY one player?
So like this:
localPlayer.PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false) --can not open player list
--gui stuff etc. etc.
localPlayer.PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true) --can open player list
All players get a copy of a local script, so all the copies are running thus everyone gets their player list disabled. I don’t know how the shop is opened, could you elaborate on that.
First of all, I have made the topbar invisible. So, when I have a below the name, it doesnt register click nor hover overs… Is there any way that the button is, like above? Or something like that.
It’s a bit complicated. Since the TextButton Click doesn’t work on Topbar, you can make own with UserInputService and MouseEnterMouseLeave event.
local Button = script.Parent -- Button
local UserInputService = game:GetService("UserInputService")
local EnabledClick = false
local function onHover()
EnabledClick = true
end
local function onUnhover()
EnabledClick = false
end
local function onClick(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and EnabledClick then
-- Mouse click code
end
end
button.MouseEnter:Connect(onHover)
button.MouseLeave:Connect(onUnhover)
UserInputService.InputBegan:Connect(onClick)
Didn’t tried it, but hopefully work. So basically this code checks if the button is hovered, then enabledClick set to true, if not then false. And UserInputService makes click event when the enabledClick is true.