Since what we are doing is going to be visible for everyone equally, we are going to use a Script (not LocalScript), you should put these into ServerScriptService. ![](https://i.imgur.com/Q1G6W9z.png) Before working with the Seat, I want to create a function which will make the character visible or invisible. A function is like a code that you write once and can repeatedly jump to and it will be executed as many times as you want. Here is an example of a simple function named `Function`: ```lua local function Function() -- Whenever you type `Function()`, the code -- jumps right here and starts running until... print("imKirda") print("imKird") print("imKir") print("imKi") print("imK") print("im") print("i") -- ...until it sees an `end` of the function end -- This is how you execute a function Function() -- After the function has hit `end`, the code is going -- to continue running from here print("The end of the program") -- We can execute the function as many times as we want Function() ``` Here is output of the code above: > imKirda > imKird > imKir > imKi > imK > im > i > The end of the program > imKirda > imKird > imKir > imKi > imK > im > i Commonly used functions are `:Connect` or `:Destroy` and `print` for example. Functions are usefull for cases where you want to use same code more than once, instead of copying it, you write it in the function. Functions can have parameters, those are normal variables which you can pass to the function when executing it: ```lua local function Function(message) print(message) print(message) print(message) print(message) print(message) print(message) print(message) end Function("This is a message") Function("This is also a message") ``` Output: > This is a message > This is a message > This is a message > This is a message > This is a message > This is a message > This is a message > This is also a message > This is also a message > This is also a message > This is also a message > This is also a message > This is also a message > This is also a message You can have as many parameters as you want, now for our case the function will do this: It will set transparency of every part inside of a character to 1 (invisible) or 0 (visible), this means it should have 2 parameters, the character himself and desire transparency: ```lua local function Set_Character_Transparency(character, transparency) end ``` ![](https://i.imgur.com/SqejWzk.png) If we have a folder with 5 decals inside and want to change Texture of every decal, we need to loop through them, in order to do that you can use this method: ```lua local folder = game.Workspace.Folder for index, decal in folder:GetChildren() do print(index, decal.Name) decal.Texture = "rbxassetid://12345678" end ``` Output: > 1 A > 2 B > 3 C > 4 D > 5 E As you can see `index` is a unique number given to every child, you don't need to use it here, that's why people often name it `_` which means like *unused*: ```lua for _, decal in folder:GetChildren() do ``` The `decal` variable is used in our case and refers to the decal object, I changed Texture property of the decal to my desired value here. In case with character we want to iterate over every descendant, those are not only children, but also children of the children and their grandchildren. That's not hard too, instead of `:GetChildren` we can use `:GetDescendants`. Okay but every character also has humanoid, attachments, joints and those kind of things that are not parts, we want to ignore the object if it's not a part, for that there is a `:IsA` function. Say we have a part in Workspace like this and we want to know if it's really a part: ![](https://i.imgur.com/UZiBOBv.png) ```lua local part = game.Workspace.Part if part:IsA("BasePart") then print("The part is a BasePart!") end if part:IsA("Folder") then print("The part is a Folder?") end ``` *BasePart are normal parts and they also include MeshParts, you can use `part:IsA("Part")` too* Output: > The part is a BasePart You see it did not print "The part is a Folder" since the part is indeed not a folder. Now the whole function would look like this: ```lua local function Set_Character_Transparency(character, transparency) for _, part in character:GetDescendants() do if part:IsA("BasePart") then part.Transparency = transparency end end end ``` The only issue is that HumanoidRootPart is part, however it should be ignored yet it won't, we need to also specify that it should be ignored since HumanoidRootPart should always stay invisible. We just check if part's name is equal to HumanoidRootPart, if it is then we don't change the transparency: ```lua if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then ``` `if A == B` means "if A is equal to B", `if A ~= B` means the opposite, "if A is not equal to B", in this it's if part is a BasePart and part's name is not equal to HumanoidRootPart then change the transparency. Next we want to know who is sitting on the seat, that is Seat.Occupant property, it refers to humanoid that is sitting on the seat. When someone sits on the seat, Seat.Occupant changes, to detect that Seat.Occupant changed we can use `:GetPropertyChangedSignal`, this will execute our function everytime a specified property changes, our specified property is Occupant. Say we have a seat like this in workspace: ![](https://i.imgur.com/uejHmVo.png) ```lua local seat = game.Workspace.Seat seat:GetPropertyChangedSignal("Occupant"):Connect(function() print("The occupant has changed") end) ``` Whenever you sit, it will print "The occupant has changed", whenever you unsit, it will also print ""The occupant has changed". Since when the Occupant changes, we don't know if someone sat or stood up, we need to check if Seat.Occupant exists, if he does then someone sat down, otherwise someone stood up: ```lua seat:GetPropertyChangedSignal("Occupant"):Connect(function() if seat.Occupant then print("Someone sat down") else print("Someone stood up") end end) ``` Okay when someone sits down, let's make him invisible using the `Set_Character_Transparency`: ```lua seat:GetPropertyChangedSignal("Occupant"):Connect(function() if seat.Occupant then Set_Character_Transparency(seat.Occupant.Parent, 1) end end) ``` Note that I wrote seat.Occupant.Parent instead of seat.Occupant since seat.Occupant is the humanoid while we need a character, humanoid is located in the character meaning character is parent of the humanoid. This is the limit of what I can explain since you are nob, the only thing left is the logic which you will only understand if you know scripting I guess. I also assume you understood 2% of what I wrote but that's understandable. The whole code: ```lua local seat = Workspace.Seat local LastOccupant = nil local function Set_Character_Transparency(character, transparency) for _, part in character:GetDescendants() do if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then part.Transparency = transparency end end end seat:GetPropertyChangedSignal("Occupant"):Connect(function() local occupant = seat.Occupant if occupant == nil and LastOccupant then Set_Character_Transparency(LastOccupant, 0) else Set_Character_Transparency(occupant.Parent, 1) LastOccupant = occupant.Parent end end) ```