You have to add it after the loop and then make a new loop the reason is every time it loops though a new body part it will wait(7) seconds
Ok, so how would I do that? here’s my code for it
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
wait(1)
for _,part in pairs(char:GetChildren()) do
if part:IsA("MeshPart") then
part.Transparency = 0.5
end
end
end)
end)
So exit the loop add the wait(7) then basically just copy-paste the loop under the wait then change the 0.5 to 0
like this?
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
wait(1)
for _,part in pairs(char:GetChildren()) do
if part:IsA("MeshPart") then
part.Transparency = 0.5
end
for _,part in pairs(char:GetChildren()) do
if part:IsA("MeshPart") then
part.Transparency = 0.5
end
end
end
end)
except with wait(7) and transparency 0
No first exit the loop so like this
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
wait(1)
for _,part in pairs(char:GetChildren()) do
if part:IsA("MeshPart") then
part.Transparency = 0.5
end
end
wait(7)
for _,part in pairs(char:GetChildren()) do
if part:IsA("MeshPart") then
part.Transparency = 0
end
end
end)
end)
It worked! Thank you!!! Now all I need is to recreate that trail effect, do you have any clue how to? lol sorry if I’m a little difficult, I’m really new to scripting.
It’s ok. I would try just cloning the player about every half a second
Okay, would I want to make a LocalScript in StarterCharacterScripts to do that? Or would I want it in the same script? oh lol I did it at the same time as you
No you would want to do it in the same script
Alright, how should I do that?
so delete the “wait(7)” from before and instead replace it with this:
–Clone Character every .1 seconds
local count = 0 -- Make a new timer
char.Archivable = true -- Set the characters Archivable property to true (so that we can clone them)
while count <= 3 do -- 3 is the Amount of time until player turns fully visible again
wait(0.1) -- Wait .1 seconds
count += 0.1 -- Add .1 to the count variable
local newChar = char:Clone() -- Clone the character
newChar.Parent = game.Workspace -- Set the cloned character's parent to the workspace
newChar.Name = player.Name.."'s clone trail" -- Change the name of the clone
newChar:FindFirstChild("Head").Name = "Head2" -- Change the name of the head of the clond so that the name text wont pop up above it
for _, part in pairs(newChar:GetChildren()) do -- make a new loop
if part:IsA("MeshPart") then
part.Anchored = true --Set every part of the cloned character to be anchored
part.CanCollide = false -- Set every part of the clone to be CanCollide false
end
end
Debris:AddItem(newChar, 3) -- Finally destroy the clone 3 seconds later
end
Note: You need to make a Debris variable at the top of the script referencing the Debris Service Like this:
local Debris = game:GetService("Debris")
I chose 3 because I felt 7 seconds is way too long
The final code for all of these posts should be something like this:
local Debris = game:GetService("Debris")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
wait(1)
for _,part in pairs(char:GetChildren()) do -- make a new loop
if part:IsA("MeshPart") then -- check if its a part
part.Transparency = 0.5 -- Set the transparency to half
end
end
--Clone Character every .5 seconds
local count = 0 -- Make a new timer
char.Archivable = true -- Set the characters Archivable property to true (so that we can clone them)
while count <= 3 do -- 3 is the Amount of time until player turns fully visible again
wait(0.1) -- Wait .1 seconds
count += 0.1 -- Add .1 to the count variable
local newChar = char:Clone() -- Clone the character
newChar.Parent = game.Workspace -- Set the cloned character's parent to the workspace
newChar.Name = player.Name.."'s clone trail" -- Change the name of the clone
newChar:FindFirstChild("Head").Name = "Head2" -- Change the name of the head of the clond so that the name text wont pop up above it
for _, part in pairs(newChar:GetChildren()) do -- make a new loop
if part:IsA("MeshPart") then
part.Anchored = true --Set every part of the cloned character to be anchored
part.CanCollide = false -- Set every part of the clone to be CanCollide false
end
end
Debris:AddItem(newChar, 3) -- Finally destroy the clone 3 seconds later
end
-- Return transparency
for _,part in pairs(char:GetChildren()) do -- make a new loop
if part:IsA("MeshPart") then -- check if its a part
part.Transparency = 0 -- Return Transparency to 0 (normal)
end
end
end)
end)
Also note this is before the loop that returns the parts to normal transparency. Also please read the comments so you understand the script instead of just copy-paste (not saying you weren’t)
It seems that CanCollide is on, where would I want to put script to turn it off?
game.Players.PlayerAdded:Connect(function(player)
local char = player.Character or player.CharacterAdded:Wait()
local HRp = char:WaitForChild(“HumanoidRootPart”)
local event = Instance.new(“Sparkles”, HRp) – make this ur thing u want to happen
wait(4)
event:Destroy()
end)
idk what u mean and im too lazy to play that game but heres a thing that could help, and if it does then ur welcome!
I might try that out, but for now I’m just going to be using what ScriptingLegend is showing me. Thanks anyway!
It seems like the part.CanCollide = false didn’t work… I’m still able to climb on top of the clones.
I would do the same he is a scripting legend and a YT.
CanCollide cant be turned off on characters (I just found out due to players just falling through the ground) unless you use collision groups which is out of my reach of knowledge so I will unfortunately not be able to help anymore. At least I was able to help with the effects though.