Guest User

How to mzke a game.

a guest
Jan 11th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. groupid = 3592403 --Write your group's id right here, you don't need to worry about anything else, unless you plan on changing colors.
  2.  
  3. game.Players.PlayerAdded:connect(onPlayerRespawned) --Connection for the function right below.
  4. function onPlayerRespawned(newPlayer) --When a player joins the "Players" service.
  5. wait(1) --Obviously waits to start the script
  6. if newPlayer then --Just checking if the player exist.
  7. gui=Instance.new("BillboardGui") --Creating a new BillboardGui
  8. gui.Parent=newPlayer.Character.Head --Inserting the BillboardGui into the player.
  9. gui.Adornee=newPlayer.Character.Head
  10. gui.Size=UDim2.new(4,0,2,0) --Leave this one be.
  11. gui.StudsOffset=Vector3.new(0,3,0) --Leave this one be.
  12. texta=Instance.new("TextBox") --Creating a new TextBox
  13. texta.Size=UDim2.new(1,0,1,0) --Leave this one be.
  14. texta.BackgroundTransparency = 1 --1 Makes the background invisible, 0 will show it.
  15. texta.Text = ("- " .. newPlayer:GetRoleInGroup(groupid) .. " -") --This changes the text to the rank in a group.
  16. texta.TextColor3 = Color3.new(50,10,255) --This is the text color of non-group members.(50,10,255) is white; (0,2,44) is teal
  17. texta.Parent=gui --Inserting the TextBox to the BillBoardGui
  18. if newPlayer:IsInGroup(groupid) then --Checking if the player actually belongs to the group.
  19. texta.TextColor3 = Color3.new(0,0,128) --This is the text color of group members.(0,0,128) is blue;(23/255,14/255,80/255) is dark purple
  20. end
  21. end
  22. end
  23.  
  24. function onPlayerEntered(newPlayer)
  25. newPlayer.Changed:connect(function (property)
  26. if (property == "Character") then
  27. onPlayerRespawned(newPlayer)
  28. end
  29. end)
  30. end
  31.  
  32. game.Players.PlayerAdded:connect(onPlayerEntered)
Advertisement
Add Comment
Please, Sign In to add comment