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

Rainbow trail script not working? AGRRGGHHHH

Revert to this for more info; https://scriptinghelpers.org/questions/46744/whats-wrong-with-my-gamepass-trails-again

local id = 971425430
 
game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
        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.Torso)
		        attachment1.Name = "trailAttachment1"
		        trail.Attachment0 = attachment0
		        trail.Attachment1 = attachment1
	        end)
        end)
    else
        print(player.Name .. " doesn't have the game pass...")
    end
end)

1 comment

0

Im learning too and am having the same sort of issues, im not sure but i have a feeling its due to the fact that the Head and Torso parts of the character arent able to be accessed in that way but im not entirely sure sorry

2 answers

id =971425430
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:Connect(function(char)
    	if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
			local trail = game.ServerStorage.Trail:Clone()
			trail.Parent = char.Torso
			trail.Attachment0 = char.Head.FaceFrontAttachment
			trail.Attachment1 = char.Torso.WaistBackAttachment
		end
	end)
end)

I think your problem is your Attachments aren't actually attachments

Sorry I forgot to say, I deleted line 5 and it worked so. Thanks to everyone who contributed!

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