Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SQURELIGHT3D
- --i was lazy to obfuscate this shi
- --btw i hope you like it BY SUSSYY
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local head = character:WaitForChild("Head")
- local squarePart = Instance.new("Part")
- squarePart.Size = Vector3.new(7, 0.1, 7)
- squarePart.Anchored = true
- squarePart.CanCollide = false
- squarePart.Material = Enum.Material.Neon
- squarePart.Color = Color3.fromRGB(50, 50, 50)
- squarePart.Transparency = 0.5
- squarePart.Parent = workspace
- local squareLight = Instance.new("PointLight")
- squareLight.Brightness = 4
- squareLight.Range = 12
- squareLight.Enabled = false
- squareLight.Parent = squarePart
- local hoverSpeed = 0.5
- local hoverHeight = 0.5
- local timePassed = 0
- local isLocked = false
- local function updateSquarePosition()
- if not isLocked then
- local currentHeadPosition = head.Position
- local newPosition = currentHeadPosition + Vector3.new(0, 3, 0)
- local distance = (squarePart.Position - newPosition).Magnitude
- local smoothFactor = 0.1
- squarePart.CFrame = CFrame.new(squarePart.Position:Lerp(newPosition, smoothFactor))
- end
- end
- game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
- timePassed = timePassed + deltaTime * hoverSpeed
- local hoverOffset = math.sin(timePassed) * hoverHeight
- updateSquarePosition()
- end)
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0.2, 0, 0.05, 0)
- toggleButton.Position = UDim2.new(0.4, 0, 0.85, 0)
- toggleButton.Text = "Toggle Square Light"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleButton.Font = Enum.Font.GothamBold
- toggleButton.TextScaled = true
- toggleButton.Parent = screenGui
- local lockButton = Instance.new("TextButton")
- lockButton.Size = UDim2.new(0.2, 0, 0.05, 0)
- lockButton.Position = UDim2.new(0.4, 0, 0.75, 0)
- lockButton.Text = "Lock Square"
- lockButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- lockButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- lockButton.Font = Enum.Font.GothamBold
- lockButton.TextScaled = true
- lockButton.Parent = screenGui
- toggleButton.MouseButton1Click:Connect(function()
- squareLight.Enabled = not squareLight.Enabled
- if squareLight.Enabled then
- squarePart.Color = Color3.fromRGB(255, 255, 255)
- squarePart.Transparency = 0
- toggleButton.Text = "Square Light On"
- else
- squarePart.Color = Color3.fromRGB(0, 0, 0)
- squarePart.Transparency = 0.5
- toggleButton.Text = "Square Light Off"
- end
- end)
- lockButton.MouseButton1Click:Connect(function()
- isLocked = not isLocked
- if isLocked then
- lockButton.Text = "Unlock Square"
- else
- lockButton.Text = "Lock Square"
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement