Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local StarterGui = game:GetService("StarterGui")
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- -- GUI Setup
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "CharacterSelectorGui"
- screenGui.ResetOnSpawn = false
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 150)
- frame.Position = UDim2.new(0.85, 0, 0.5, -75)
- frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- frame.Parent = screenGui
- -- Button creation function
- local function createButton(name, position)
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(0.9, 0, 0.25, 0)
- button.Position = position
- button.Text = name
- button.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.Parent = frame
- return button
- end
- -- Character Functions
- local function setupLaserEye()
- local player = Players.LocalPlayer
- local character = player.Character
- if not character then return end
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.WalkSpeed = 16
- local eye = Instance.new("Part")
- eye.Shape = Enum.PartType.Ball
- eye.Size = Vector3.new(2, 2, 2)
- eye.CanCollide = false
- eye.Anchored = true
- eye.Parent = character
- local decal = Instance.new("Decal")
- decal.Texture = "rbxassetid://6755657145"
- decal.Face = Enum.NormalId.Front
- decal.Parent = eye
- local function updateEyePosition()
- local basePos = character.HumanoidRootPart.Position + Vector3.new(0, 5, 0)
- local time = tick()
- eye.Position = basePos + Vector3.new(0, math.sin(time) * 0.5, 0)
- end
- local function shootBeam(targetPos)
- local beam = Instance.new("Part")
- beam.Size = Vector3.new(0.2, 0.2, 10)
- beam.CanCollide = false
- beam.Anchored = true
- beam.Position = eye.Position
- beam.CFrame = CFrame.lookAt(eye.Position, targetPos)
- local colors = {
- Color3.fromRGB(0, 255, 255), -- cyan
- Color3.fromRGB(255, 0, 0), -- red
- Color3.fromRGB(255, 165, 0), -- orange
- Color3.fromRGB(0, 255, 0), -- green
- Color3.fromRGB(255, 255, 0), -- yellow
- Color3.fromRGB(0, 255, 0) -- lime
- }
- beam.Color = colors[math.random(1, #colors)]
- beam.Parent = workspace
- game:GetService("Debris"):AddItem(beam, 3)
- TweenService:Create(beam, TweenInfo.new(3), {Transparency = 1}):Play()
- end
- local mouse = player:GetMouse()
- local mouseConnection = mouse.Button1Down:Connect(function()
- shootBeam(mouse.Hit.Position)
- end)
- local updateConnection = RunService.Heartbeat:Connect(updateEyePosition)
- return function()
- mouseConnection:Disconnect()
- updateConnection:Disconnect()
- eye:Destroy()
- end
- end
- local function setupFlash()
- local player = Players.LocalPlayer
- local character = player.Character
- if not character then return end
- local humanoid = character:WaitForChild("Humanoid")
- local shirt = Instance.new("Shirt")
- shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=2697520779"
- shirt.Parent = character
- local pants = Instance.new("Pants")
- pants.PantsTemplate = "http://www.roblox.com/asset/?id=2697522843"
- pants.Parent = character
- local currentSpeed = 16
- local maxSpeed = 100
- local connection = RunService.Heartbeat:Connect(function(delta)
- if humanoid.MoveDirection.Magnitude > 0 then
- currentSpeed = math.min(currentSpeed + (delta * 40), maxSpeed)
- humanoid.WalkSpeed = currentSpeed
- workspace.CurrentCamera.FieldOfView = 70 + (currentSpeed - 16) * 0.3
- else
- currentSpeed = 16
- humanoid.WalkSpeed = currentSpeed
- workspace.CurrentCamera.FieldOfView = 70
- end
- end)
- return function()
- connection:Disconnect()
- workspace.CurrentCamera.FieldOfView = 70
- if shirt then shirt:Destroy() end
- if pants then pants:Destroy() end
- end
- end
- local function setupMario()
- local player = Players.LocalPlayer
- local character = player.Character
- if not character then return end
- local humanoid = character:WaitForChild("Humanoid")
- local rootPart = character:WaitForChild("HumanoidRootPart")
- local jumpCount = 0
- local isGroundPounding = false
- local shirt = Instance.new("Shirt")
- shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=9619000970"
- shirt.Parent = character
- local pants = Instance.new("Pants")
- pants.PantsTemplate = "http://www.roblox.com/asset/?id=9619006570"
- pants.Parent = character
- local function onJump()
- if isGroundPounding then return end
- jumpCount = jumpCount + 1
- if jumpCount <= 3 then
- if jumpCount == 1 then
- humanoid.JumpPower = 50
- elseif jumpCount == 2 then
- rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 50, rootPart.Velocity.Z)
- elseif jumpCount == 3 then
- rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 40, rootPart.Velocity.Z)
- isGroundPounding = true
- humanoid.PlatformStand = true
- task.wait(1)
- rootPart.Velocity = Vector3.new(0, -100, 0)
- task.wait(0.5)
- humanoid.PlatformStand = false
- isGroundPounding = false
- jumpCount = 0
- end
- end
- end
- local function onStateChanged(_, new)
- if new == Enum.HumanoidStateType.Landed then
- task.wait(0.1)
- if not isGroundPounding then
- jumpCount = 0
- end
- end
- end
- local jumpConnection = humanoid.Jumping:Connect(onJump)
- local stateConnection = humanoid.StateChanged:Connect(onStateChanged)
- return function()
- jumpConnection:Disconnect()
- stateConnection:Disconnect()
- if shirt then shirt:Destroy() end
- if pants then pants:Destroy() end
- end
- end
- -- Current character cleanup function
- local currentCleanup = nil
- -- Create buttons
- local laserEyeBtn = createButton("LaserEye", UDim2.new(0.05, 0, 0.05, 0))
- local flashBtn = createButton("The Flash", UDim2.new(0.05, 0, 0.35, 0))
- local marioBtn = createButton("Mr Mario", UDim2.new(0.05, 0, 0.65, 0))
- -- Button handlers
- laserEyeBtn.MouseButton1Click:Connect(function()
- if currentCleanup then currentCleanup() end
- currentCleanup = setupLaserEye()
- end)
- flashBtn.MouseButton1Click:Connect(function()
- if currentCleanup then currentCleanup() end
- currentCleanup = setupFlash()
- end)
- marioBtn.MouseButton1Click:Connect(function()
- if currentCleanup then currentCleanup() end
- currentCleanup = setupMario()
- end)
- screenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement