Hello! I found this script it’s a trail tutorial a rainbow one from Alvin BlOX script not working pls help code:
First and for most, I’d recommend copying and pasting the code onto the developer forum, a photo from a secondary device wouldn’t be my first option.
Second,
trail.Attachment = attachment1
The “a” in the “attachment1” should be capitalized.
Next, no idea why there’s two ``, there should be 1 of them if I’m not mistaken.
Mainly all you have to do is fix the capitalization to the variables EXACT name.
Also, the category should be #help-and-feedback:scripting-support
Okay, replace
‘’
with
"
You’re using two apostrophes where there should be a quote mark around strings.
Also, Lua is case-sensitive. Referring to attachment1
is different than the Attachment1
you created.
So deleted the attachment and ,?
could you send the code in text so i can edit them cuz image is kinda hard
Kk I will try tho to write it in letters
you can just copy and paste you dont have to write them ;-;
Highlight the code, press ctrl + c, then press ctrl + v in the replies.
game.players.PlayersAdded:connect (function(player)
player.characterAdded:connect(function(char)
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="TrailAttachment1"
trail.Attachment0 = Attachment0
trail.Attachment1 = Attachment1
end)
end)
Try this. Your code formatting is completely messed up, and I fixed it for you. I think you’re a beginner so I’ll help you out here. If it works, please mark as solution:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local trail = game.ServerStorage.Trail:Clone()
trail.Parent = char:WaitForChild("Head")
local Att0 = Instance.new("Attachment", char.Head)
Att0.Name = "TrailAttachment0"
local Att1 = Instance.new("Attachment", char:WaitForChild("HumanoidRootPart"))
Att1.Name = "TrailAttachment1"
trail.Attachment0 = Att0
trail.Attachment1 = Att1
end)
end)
it worked how did ya fix code ty
You formatted the code in the completely wrong way. You had a quote after char,
and that completely messed up the code. At the top in Line 1, PlayersAdded is not a real function, and I would replace game.players with game.Players. PlayersAdded should be PlayerAdded there. That’s what I can find so far. Please mark the post as solution by clicking the “Solution” button next to the heart icon.
i marked the code you post solution
Ok, thank you! Make sure to check your formatting and look for context clues in errors next time!