Elixcore

Untitled

Jul 17th, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1.  
  2. local ServerStorage = game.ServerStorage.RainbowTrail:Clone()
  3. local gamepassid = 10498381
  4.  
  5. local function hasGP(pid, gpid)
  6. return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(pid, gpid)
  7. end
  8.  
  9. local function attach(child, attachments)
  10. for i = 1,#attachments do
  11. local offset = tostring(i -1)
  12. local attachment = Instance.new("Attachment")
  13. attachment.Parent = attachments[i]
  14. attachment.Name = "TrailAttachment"..offset
  15. child["Attachment"..offset] = attachment
  16. end
  17. child.Parent = attachments[1]
  18. end
  19.  
  20. game.Players.PlayerAdded:Connect(function(plr)
  21. plr.CharacterAdded:Connect(function(chr)
  22. if hasGP(plr.UserId, gamepassid) then
  23. attach(ServerStorage, {chr.Head, chr.HumanoidRootPart})
  24. end
  25. end)
  26. end)
Add Comment
Please, Sign In to add comment