Server Script in ServerScriptService:
local ServerStorage = game.ServerStorage.RainbowTrail:Clone() local gamepassid = 10498381 local function hasGP(pid, gpid) return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(pid, gpid) end local function attach(child, attachments) for i = 1,#attachments do local offset = tostring(i -1) local attachment = Instance.new("Attachment") attachment.Parent = attachments[i] attachment.Name = "TrailAttachment"..offset child["Attachment"..offset] = attachment end child.Parent = attachments[1] end game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(chr) if hasGP(plr.UserId, gamepassid) then attach(ServerStorage, {chr.Head, chr.HumanoidRootPart}) end end) end)
For some reason the trail only works on 1 player at a time. Ex: I had the trail, my friend joined, my trail got deleted and the trail went to him.
-- took me 5 mins lol local gamePassId = 10498381 local RainbowTrail = game.ServerStorage.RainbowTrail local function UserOwnsGamePassAsync(player, gamePassId) local hasGamepass = false local MarketplaceSuccess, MarketplaceErr = pcall(function() -- Wrap in a pcall because errors can come up. hasGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamePassId) end) if MarketplaceSuccess then return hasGamepass else warn("Error on MarketplaceService:UserOwnsGamePassAsync: ", MarketplaceErr) return false end end local function attach(ch, att) for i = 1, #att do local off = tostring(i-1) local attachment = Instance.new("Attachment") attachment.Parent = att[i] attachment.Name = "TrailAttachment-"..off ch["Attachment"..off] = attachment end ch.Parent = att[1] end local Players = game:GetService("Players") Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) if UserOwnsGamePassAsync(plr, gamePassId) then attach(RainbowTrail:Clone(), {char.Head, char.HumanoidRootPart}) end end) end)
Try cloning the trail and moving its parent.