Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I manage to permanently remove this button?

Asked by
Silicti 40
8 years ago
script.Parent.MouseButton1Click:connect(function(click)
    script.Parent.Remove() -- This line is the button
    game.Workspace.CurrentCamera.blur:Remove()
    game.StarterGui:SetCoreGuiEnabled(0,true)
end)

The part I commented is the button.

Whenever the character resets, the button shows up, but nothing else.

How would I make this button not show up, even after resetting?

1 answer

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

You likely have the Button in StarterGui, which always is sent to the player after a reset, but nothing else. I suggest you create a BoolValue in the Player called something like "ButtonSeen". Then, once the button is clicked, you can set this value to true. Then in this script, you can add something at the top like:

if game.Players.LocalPlayer.ButtonSeen.Value == true then
    script.Parent:Destroy()
end

If you are unsure how to create a BoolValue in the player, you can:

  1. Create a new script in the ServerScriptService

  2. Set the script's content to the following:

game.Players.PlayerAdded:connect(function(Player)
    Instance.new("BoolValue", Player).Name = "ButtonSeen"
end)
  1. Now the value should have been created and you may now manipulate it. It will not disappear unless the player leaves.

Also, it is worth noting I am using :Destroy() instead of :Remove() as :Remove() has been deprecated. I suggest you change that in your code as well.

0
:Remove() is deprecated. Use :Destroy() instead. GoldenPhysics 474 — 8y
0
GoldenPhysics, I'm very aware of this. I simply used the remove method because it seemed OP was used to it. voximity 75 — 8y
Ad

Answer this question