Hi, I was wondering how I can make it when I sit on a seat my character’s body parts become transparent.
use a for i, v in pairs () do function when a player touches the seat with a touched function. use "BasePart" to find out that it’s a part and change its transparency to 1.
1 Like
The problem with that is it doesn’t do anything with hats/hair
This is just a simple example you could put under your seat.
script.Parent.Touched:Connect(function(part)
local plr = game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
if plr then
for i, v in pairs(plr:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 1
end
end
end
end)
1 Like
By the way correction
script.Parent.Touched:Connect(function(part)
local plr = game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
if plr then
print("yes")
for i, v in pairs(plr.Character:GetChildren()) do
if v:IsA("MeshPart") then
print("se")
v.Transparency = 1
end
end
end
end)
1 Like