Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plrs = {}
- function UserFromId(userId)
- local userSets = game:GetService("InsertService"):GetUserSets(userId) --get the user's sets
- for _,v in pairs(userSets) do --iterate through then
- if v.Name == "My Models" then --check if this is the player's models
- return v.CreatorName --returning the name of the creator of the set "My Models" (the player)
- end
- end
- end
- print()
- plrs = {}
- local h = Instance.new("Hint",workspace) h.Text = "Time for a mix up! Everyone swaps characters on respawn!" delay(3,function()
- h:Destroy() end)
- game.Players.PlayerAdded:connect(function(p)
- if p:IsA("Player") then
- table.insert(plrs,p.UserId)
- local debounce = false
- p.Changed:connect(function()
- if debounce == false then
- debounce = true
- p.CharacterAppearance = ([[http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId=]]..plrs[math.random(1,table.getn(plrs))])
- wait()
- debounce = false
- end
- end)
- p.Changed:connect(function(a)
- print(tostring(a))
- end)
- delay(1,function() p:LoadCharacter() end)
- end
- end)
- for index, p in pairs(game:GetService'Players':GetChildren()) do
- table.insert(plrs,p.UserId) local debounce = false
- p.Changed:connect(function()
- if debounce == false then debounce = true
- local int = math.random(1,table.getn(plrs))
- p.CharacterAppearance = ([[http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId=]]..plrs[int])
- wait() debounce = false end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement