Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UIS = game:GetService("UserInputService")
- local gui
- function map(x,in_min,in_max,out_min,out_max)
- return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
- end
- local toggle = false
- UIS.InputBegan:Connect(function(key)
- if key.KeyCode == Enum.KeyCode.P then
- toggle = not toggle
- if toggle == true then
- for i,v in pairs(game.Players:GetPlayers())do
- if _G.TeamMode == true then
- local gui = Instance.new("BillboardGui",v.Character.HumanoidRootPart)
- gui.Size = UDim2.new(0,100,0,20)
- gui.AlwaysOnTop = true
- gui.Name = "theGui"
- local TextBox = Instance.new("TextLabel",gui)
- TextBox.Size = UDim2.new(1,0,0,20)
- TextBox.BorderSizePixel = 5
- TextBox.BorderColor3 = Color3.fromRGB(25,25,25)
- TextBox.Text = tostring(v.Team)
- TextBox.BackgroundColor3 = Color3.fromRGB(25,25,25)
- TextBox.TextColor3 = Color3.fromRGB(150,150,150)
- TextBox.BackgroundTransparency = 0.3
- TextBox.TextSize = 18
- TextBox.BackgroundColor3 = v.TeamColor.Color
- local color = v.TeamColor.Color
- local colorR = map(color.R, 1, 0, 0, 1)
- local colorG = map(color.G, 1, 0, 0, 1)
- local colorB = map(color.B, 1, 0, 0, 1)
- TextBox.TextColor3 = Color3.new(colorR,colorG,colorB)
- gui.Size = UDim2.new(0,TextBox.TextBounds.X + 10,0,TextBox.TextBounds.Y + 5)
- elseif _G.PersonMode == true then
- local gui = Instance.new("BillboardGui",v.Character.HumanoidRootPart)
- gui.Size = UDim2.new(0,100,0,20)
- gui.AlwaysOnTop = true
- gui.Name = "theGui"
- local TextBox = Instance.new("TextLabel",gui)
- TextBox.Size = UDim2.new(1,0,0,20)
- TextBox.BorderSizePixel = 5
- TextBox.BorderColor3 = Color3.fromRGB(25,25,25)
- TextBox.Text = tostring(v.Name)
- TextBox.BackgroundColor3 = Color3.fromRGB(25,25,25)
- TextBox.TextColor3 = Color3.fromRGB(150,150,150)
- TextBox.BackgroundTransparency = 0.3
- TextBox.TextSize = 18
- gui.Size = UDim2.new(0,TextBox.TextBounds.X + 10,0,TextBox.TextBounds.Y + 5)
- TextBox.BackgroundColor3 = v.Character:FindFirstChild("Head").Color
- local color = v.Character:FindFirstChild("Head").Color
- local colorR = map(color.R, 1, 0, 0, 1)
- local colorG = map(color.G, 1, 0, 0, 1)
- local colorB = map(color.B, 1, 0, 0, 1)
- TextBox.TextColor3 = Color3.new(colorR,colorG,colorB)
- end
- end
- end
- if toggle == false then
- for i,v in pairs(game.Players:GetPlayers())do
- if v.Character.HumanoidRootPart:FindFirstChild("theGui") then v.Character.HumanoidRootPart.theGui:Destroy() end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement