Advertisement
TheFlamingBlaster

MixItUp

Aug 27th, 2016
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. plrs = {}
  2. function UserFromId(userId)
  3. local userSets = game:GetService("InsertService"):GetUserSets(userId) --get the user's sets
  4. for _,v in pairs(userSets) do --iterate through then
  5. if v.Name == "My Models" then --check if this is the player's models
  6. return v.CreatorName --returning the name of the creator of the set "My Models" (the player)
  7. end
  8. end
  9. end
  10.  
  11. print()
  12. plrs = {}
  13. local h = Instance.new("Hint",workspace) h.Text = "Time for a mix up! Everyone swaps characters on respawn!" delay(3,function()
  14. h:Destroy() end)
  15. game.Players.PlayerAdded:connect(function(p)
  16. if p:IsA("Player") then
  17. table.insert(plrs,p.UserId)
  18. local debounce = false
  19. p.Changed:connect(function()
  20. if debounce == false then
  21. debounce = true
  22. p.CharacterAppearance = ([[http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId=]]..plrs[math.random(1,table.getn(plrs))])
  23. wait()
  24. debounce = false
  25. end
  26. end)
  27. p.Changed:connect(function(a)
  28. print(tostring(a))
  29. end)
  30. delay(1,function() p:LoadCharacter() end)
  31. end
  32. end)
  33. for index, p in pairs(game:GetService'Players':GetChildren()) do
  34. table.insert(plrs,p.UserId) local debounce = false
  35. p.Changed:connect(function()
  36. if debounce == false then debounce = true
  37. local int = math.random(1,table.getn(plrs))
  38. p.CharacterAppearance = ([[http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId=]]..plrs[int])
  39. wait() debounce = false end
  40. end)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement