If The Player Touches A Part, That Player Gets A Trail, I'm Trying To Do It But Nothing Is Happening I Get The Error: ServerScriptService.Trail:2: attempt to index local 'player' (a nil value) Anyone Can Help? Thanks
local player = game.Players.LocalPlayer
local char = player.Character
game.Workspace.Part.Touched:Connect(function()
local trail = game.ServerStorage.Trail:Clone()
trail.Parent = char.Head
local attachment0 = Instance.new("Attachment", char.Head)
attachment0.Name = "TrailAttachment0"
local attachment1 = Instance.new("Attachment", char.HumanoidRootPart)
attachment1.Name = "TrailAttachment0"
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
end)

4 comments
Is this in a LocalScript? If not, it's because
LocalPlayer's for LocalScripts only.It Is LocalScript But Still, I Touch The Brick and It Won't Give Me The Trail Why?
It should be a Script because it's in the ServerScriptService.
learn english kid