Does :Destroy Delete for the server or the Local Player?

  1. What do you want to achieve? Keep it simple and clear!

I want to know, Does :Destroy, Destroy the object for the local player or the server?

  1. What is the issue?
    I don’t know if it does destroy for the server

  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have looked at the developer Hub about Instance:Destroy() But I don’t know.

Tried: Local Scripts and Server Scripts.

1 Like

If you destroy Instance’s on a local script it would destroy the Instance only for the local player.
If you destroy Instance’s on a server script it would destroy the Instance for all players.

4 Likes

as Terminaror said , it depends on which script youre using

1 Like

So lets say, the player types /cmds and a UI opens. then there’s a button that closes the UI (The code is in a local script) and I use :Destroy() that would only get rid of it for the local player

1 Like

Yes. It will destroy the instance for the local player only.

2 Likes

It would get rid of the UI permanently. Which means if the local player presses the close button, and says the /cmds message again it would error because the GUI has been destroyed and returns nil. I would prefer changing Visible to false instead of destroying.

1 Like

So what I want to do is when a player says /cmds, It clones it, Would that matter (I am still learning scripting)

I would prefer changing the property “Visible”

1 Like