Hi,
I am creating a script, which allows a specific player to open a button, which would reveal other textbuttons(that other players can’t see). But the script isn’t working.
Hi,
I am creating a script, which allows a specific player to open a button, which would reveal other textbuttons(that other players can’t see). But the script isn’t working.
Should be open.MouseButton1Click not open.Activated.
but open is the variable for the button, which the player would click.
Replace Activated with MouseButton1Click.
Isn’t mousebutton1click the same as activated?
Once I used Activated as an alternative to MouseButton1Click (for testing purposes), but Activated did not work like MouseButton1Click. Therefore, MouseButton1Click is different from Activated.
local commandbox = script.Parent.TestercommandsBox
local Open = script.Parent.Open
local player = game.Players.LocalPlayer
Open.MouseButton1Click:Connect(function()
if player.Name == "Ghost8058" then
commandbox.Visible = true
else
commandbox.Visible = false
end
end)
ok, i will try if it works with mousebutton1click, tomorrow. A bit busy right now.
local PlayersAllowed = {
-- Player ID's here
}
local function PlayersAllowed(Player)
for _, userId in ipairs(PlayersAllowed) do
if Player.UserId == playeridhere then
return true
end
end
return false
end
-- Continue with your code
I believe Activated is somewhat a new event, or if not, then I must have never heard of it. Normally MouseButton1Click is the action when a player clicks a button, it works on all platforms and I have seen it in other games.
I hope this helps!
Activated is an event that triggers whenever LMB is pressed down. Deactivated is an event that triggers whenever someone lets go of LMB. They are both used for Tools only!
While that is true, it is also on GuiObjects.
Huh, never heard about that either.
Put this “tester commands” in starter GUI.
Thanks it worked! But how do i add more than one player to the list? Because right now, only i am able to see the Tester commandbox.

What does this bit do? I’m interested
It’s a for loop that helps find out if the player is allowed to use the gui. Btw i made a mistake, check the code out again, it should work
Ok here is where you have it wrong “Activated” is something used for tools when it is clicked on. Change the code to
Open.MouseButton1Click:Connect(function()
Here is how you would add more then one player.
if player.Name == “Ghost8058” or “VeinTweek” or “ROBLOX” then
just keep adding an or.
Activated is not only for tools, please refer to my post.