Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

In the output box it says Trail is missing from the ServerStorage yet it is there.Please help?

2 answers

Scripts that load immediately often have errors like this because objects typically aren't instantly loaded in. The best way to fix this would be to use :WaitForChild to make sure that the script can see the object before you try to reference it. This should fix your problem:

local Trail = game.ServerStorage:WaitForChild("Trail")

game.Players.PlayerAdded:Connect(function(Player)
     Player.CharacterAdded:Connect(function(Character)
          local PlayerTrail = Trail:Clone()
          PlayerTrail.Parent = Character.Torso
          PlayerTrail.Attachment0 = Character.Head.FaceFrontAttachment
          PlayerTrail.Attachment1 = Character.Torso.WaistBackAttachment
     end)
end)

That's not how you get objects.

You should either do

local Trail = game.ServerStorage.Trail

or

local Trail = game.ServerStorage:WaitForChild("Trail")

But you don't use () parantheses to index an object. At most [] ones to evaluate the string you put inside them.

This discussion is preserved as it was. New answers, comments, and votes are closed.