Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Chat color algorithm...
- local CHAT_COLORS =
- {
- Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
- Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
- Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
- BrickColor.new("Bright violet").Color,
- BrickColor.new("Bright orange").Color,
- BrickColor.new("Bright yellow").Color,
- BrickColor.new("Light reddish violet").Color,
- BrickColor.new("Brick yellow").Color,
- }
- function GetNameValue(pName)
- local value = 0
- for index = 1, #pName do
- local cValue = string.byte(string.sub(pName, index, index))
- local reverseIndex = #pName - index + 1
- if #pName%2 == 1 then
- reverseIndex = reverseIndex - 1
- end
- if reverseIndex%4 >= 2 then
- cValue = -cValue
- end
- value = value + cValue
- end
- return value
- end
- --
- local player = game.Players.LocalPlayer
- local camera = workspace.Camera
- local mouse = player:GetMouse()
- local RS = game:GetService("RunService").RenderStepped
- local char = player.Character
- if char then
- char:Destroy()
- end
- local color = CHAT_COLORS[(GetNameValue(player.Name) % #CHAT_COLORS) + 1]
- function makeEyeballPart(part, parent)
- if part == "base" then
- local base = Instance.new("Part", parent)
- base.Name = "base"
- base.Color = color
- base.Transparency = 0.275
- base.Material = "SmoothPlastic"
- base.Size = Vector3.new(1.5, 1.5, 1.5)
- base.Shape = 0
- base.CanCollide = false
- base.Anchored = true
- base.LocalTransparencyModifier = 10
- local nameBillboard = Instance.new("BillboardGui", base)
- nameBillboard.LightInfluence = 0
- nameBillboard.Size = UDim2.new(0, 105, 0, 105)
- nameBillboard.AlwaysOnTop = true
- local playerName = Instance.new("TextLabel", nameBillboard)
- playerName.Name = "PlayerName"
- playerName.Size = UDim2.new(0, 2000, 0, 5)
- playerName.Position = UDim2.new(0, -950, 0, -145)
- playerName.BackgroundTransparency = 1
- playerName.Font = "ArialBold"
- playerName.TextSize = 13
- playerName.TextColor3 = Color3.new(1, 1, 1)
- playerName.TextStrokeTransparency = 0
- playerName.TextStrokeColor3 = Color3.new(0, 0, 0)
- playerName.TextWrapped = true
- playerName.Text = player.Name
- return base
- elseif part == "arrow" then
- local arrow = Instance.new("Part", parent)
- arrow.Name = "arrow"
- arrow.Color = color
- arrow.Transparency = 0.275
- arrow.Material = "SmoothPlastic"
- arrow.Size = Vector3.new(0.3, 0.6, 0.3)
- arrow.CanCollide = false
- arrow.Anchored = true
- arrow.LocalTransparencyModifier = 10
- local arrowMesh = Instance.new("SpecialMesh", arrow)
- arrowMesh.MeshId = "rbxassetid://785967755"
- arrowMesh.Scale = Vector3.new(0.006, 0.012, 0.006)
- return arrow
- elseif part == "line" then
- local line = Instance.new("Part", parent)
- line.Name = "line"
- line.Color = color
- line.Transparency = 0.275
- line.Material = "SmoothPlastic"
- line.Size = Vector3.new(2.25, 0.125, 0.125)
- line.Shape = 2
- line.CanCollide = false
- line.Anchored = true
- line.LocalTransparencyModifier = 10
- return line
- end
- end
- -- make eyeball model
- local eyeBall = Instance.new("Model", workspace)
- eyeBall.Name = player.Name .. "'s Eyeball"
- mouse.TargetFilter = eyeBall
- local base = makeEyeballPart("base", eyeBall)
- local arrow = makeEyeballPart("arrow", eyeBall)
- local line = makeEyeballPart("line", eyeBall)
- -- undestroyable
- eyeBall.ChildRemoved:connect(function(part)
- if part.Name == "base" then
- base = makeEyeballPart("base", eyeBall)
- elseif part.Name == "arrow" then
- arrow = makeEyeballPart("arrow", eyeBall)
- elseif part.Name == "line" then
- line = makeEyeballPart("line", eyeBall)
- end
- end)
- workspace.ChildRemoved:connect(function(part)
- if part.Name == player.Name .. "'s Eyeball" then
- local eyeBall = Instance.new("Model", workspace)
- eyeBall.Name = player.Name .. "'s Eyeball"
- mouse.TargetFilter = eyeBall
- base = makeEyeballPart("base", eyeBall)
- arrow = makeEyeballPart("arrow", eyeBall)
- line = makeEyeballPart("line", eyeBall)
- eyeBall.ChildRemoved:connect(function(part)
- if part.Name == "base" then
- base = makeEyeballPart("base", eyeBall)
- elseif part.Name == "arrow" then
- arrow = makeEyeballPart("arrow", eyeBall)
- elseif part.Name == "line" then
- line = makeEyeballPart("line", eyeBall)
- end
- end)
- end
- end)
- --
- local focus = Instance.new("Part", camera)
- focus.Anchored = true
- focus.Transparency = 1
- focus.CanCollide = false
- focus.Size = Vector3.new(0, 0, 0)
- focus.CFrame = camera.CFrame
- focus.Shape = 0
- camera.CameraSubject = focus
- camera.CameraType = Enum.CameraType.Watch
- local keyW = false
- local keyA = false
- local keyS = false
- local keyD = false
- local keyQ = false
- local keyE = false
- local keyShift = false
- local settings = {
- speedIncrement = 0.005,
- speed = 0.5, -- default is 1
- slowSpeed = 0.2,
- collidable = false
- }
- if settings.collidable == true then
- base.CanCollide = true
- arrow.CanCollide = true
- line.CanCollide = true
- end
- local speed = settings.speed
- local plrBillboard = Instance.new("BillboardGui", camera)
- plrBillboard.LightInfluence = 0
- plrBillboard.Size = UDim2.new(0, 105, 0, 105)
- plrBillboard.AlwaysOnTop = true
- plrBillboard.Adornee = nil
- local plrName = Instance.new("TextLabel", plrBillboard)
- plrName.Name = "PlayerName"
- plrName.Size = UDim2.new(0, 2000, 0, 5)
- plrName.Position = UDim2.new(0, -950, 0, 45)
- plrName.BackgroundTransparency = 1
- plrName.Font = "ArialBold"
- plrName.TextSize = 13
- plrName.TextColor3 = Color3.new(1, 1, 1)
- plrName.TextStrokeTransparency = 0
- plrName.TextStrokeColor3 = Color3.new(0, 0, 0)
- plrName.TextWrapped = true
- plrName.Text = ""
- function Update()
- if keyW == true or keyA == true or keyS == true or keyD == true
- or keyQ == true or keyE == true then
- speed = speed + settings.speedIncrement
- end
- base.CFrame = camera.CFrame
- line.CFrame = camera.CFrame * CFrame.Angles(0, math.rad(90), 0)
- arrow.CFrame = line.CFrame * CFrame.new(line.Size.X/2 + arrow.Size.Y/2, 0, 0) * CFrame.Angles(0, 0, math.rad(-90))
- plrBillboard.Adornee = nil
- plrName.Text = ""
- local target = mouse.Target
- if target then
- local hum = target.Parent:FindFirstChild("Humanoid")
- if hum then
- plrBillboard.Adornee = target.Parent.Head
- plrName.Text = target.Parent.Name
- end
- end
- end
- game:GetService("RunService").RenderStepped:connect(Update)
- mouse.KeyDown:connect(function(key)
- local tempSpeed = speed
- if string.byte(key) == 47 or string.byte(key) == 48 then
- keyShift = true
- end
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- end
- local tempCFrame = camera.CFrame
- if string.lower(key) == "w" then
- keyW = true
- repeat
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- else
- tempSpeed = speed
- end
- camera.CFrame = camera.CFrame + (camera.CFrame.lookVector*tempSpeed)
- focus.CFrame = camera.CFrame + (camera.CFrame.lookVector*1.725)
- RS:wait()
- until keyW == false
- end
- if string.lower(key) == "a" then
- keyA = true
- repeat
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- else
- tempSpeed = speed
- end
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- camera.CFrame = camera.CFrame + (tempCFrame.lookVector*tempSpeed)
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0)
- focus.CFrame = camera.CFrame + (tempCFrame.lookVector*1.725)
- RS:wait()
- until keyA == false
- end
- if string.lower(key) == "s" then
- keyS = true
- repeat
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- else
- tempSpeed = speed
- end
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(180), 0)
- camera.CFrame = camera.CFrame + (tempCFrame.lookVector*tempSpeed)
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(-180), 0)
- focus.CFrame = camera.CFrame - (tempCFrame.lookVector*1.725)
- RS:wait()
- until keyS == false
- end
- if string.lower(key) == "d" then
- keyD = true
- repeat
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- else
- tempSpeed = speed
- end
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- camera.CFrame = camera.CFrame + (tempCFrame.lookVector*tempSpeed)
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0)
- focus.CFrame = camera.CFrame + (tempCFrame.lookVector*1.725)
- RS:wait()
- until keyD == false
- end
- if string.lower(key) == "e" then
- keyQ = true
- repeat
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- else
- tempSpeed = speed
- end
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
- camera.CFrame = camera.CFrame + (tempCFrame.lookVector*tempSpeed)
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, 0)
- focus.CFrame = camera.CFrame - (tempCFrame.lookVector*1.725)
- RS:wait()
- until keyQ == false
- end
- if string.lower(key) == "q" then
- keyE = true
- repeat
- if keyShift == true then
- tempSpeed = settings.slowSpeed
- else
- tempSpeed = speed
- end
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0)
- camera.CFrame = camera.CFrame + (tempCFrame.lookVector*tempSpeed)
- tempCFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
- focus.CFrame = camera.CFrame + (tempCFrame.lookVector*1.725)
- RS:wait()
- until keyE == false
- end
- end)
- mouse.KeyUp:connect(function(key)
- if string.lower(key) == "w" then
- keyW = false
- end
- if string.lower(key) == "a" then
- keyA = false
- end
- if string.lower(key) == "s" then
- keyS = false
- end
- if string.lower(key) == "d" then
- keyD = false
- end
- if string.lower(key) == "e" then
- keyQ = false
- end
- if string.lower(key) == "q" then
- keyE = false
- end
- if keyW == false and keyA == false and keyS == false and keyD == false
- and keyQ == false and keyE == false then
- speed = settings.speed
- end
- if string.byte(key) == 47 or string.byte(key) == 48 then
- keyShift = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement