Why hello again. Yes I ask again a lot.
Don’t be scared by my code, couldn’t find anything else to do when setting the transparency of everything.
Here’s my script, I will explain after:
local tool = script.Parent
local character = tool.Parent
local Dissapear = tool:WaitForChild("Dissapear")
local debounce = false
Dissapear.OnServerEvent:Connect(function(player, character)
for _, Hat in pairs(character:GetChildren()) do
if Hat:IsA('Accessory') and debounce == false then
task.wait(1)
Hat.Parent = game.ServerStorage
local sound = Instance.new("Sound", tool.Handle)
sound.SoundId = "rbxassetid://835453268"
sound.Volume = 1
debounce = true
--player INVISIBLE!
local head = character:WaitForChild("Head")
head.Transparency = 1
head:WaitForChild("face").Transparency = 1
character:WaitForChild("Torso").Transparency = 1
character:WaitForChild("Left Arm").Transparency = 1
character:WaitForChild("Right Arm").Transparency = 1
character:WaitForChild("Left Leg").Transparency = 1
character:WaitForChild("Right Leg").Transparency = 1
wait(1)
Hat.Parent = tool.Parent
debounce = false
sound:Destroy()
--player is visible again
local head = character:WaitForChild("Head")
head.Transparency = 0
head:WaitForChild("face").Transparency = 0
character:WaitForChild("Torso").Transparency = 0
character:WaitForChild("Left Arm").Transparency = 0
character:WaitForChild("Right Arm").Transparency = 0
character:WaitForChild("Left Leg").Transparency = 0
character:WaitForChild("Right Leg").Transparency = 0
end
end
end)
So basically it doesn’t print out errors, but it doesn’t make the player Invisible, nor does it parent the players hats into ServerStorage. It just deletes the hats. And I need a better way of doing this.
I’ve tried doing :GetService(“ServerStorage”) and it didn’t work, same thing happens. No errors at all.
(If you are still not annoyed with me flooding your page with nothing but failed projects lol) I appreciate your help if you do.