Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game.PlaceId ~= 337856574 then
- GameUI = Instance.new("ScreenGui")
- QuestionFrame = Instance.new("Frame")
- QuestionLabel = Instance.new("TextLabel")
- QuestionLabelUICorner = Instance.new("UICorner")
- QuestionFrameUICorner = Instance.new("UICorner")
- TextLabel = Instance.new("TextLabel")
- TextLabelUICorner = Instance.new("UICorner")
- YesButton = Instance.new("TextButton")
- YesButtonUICorner = Instance.new("UICorner")
- NoButton = Instance.new("TextButton")
- NoButtonUICorner = Instance.new("UICorner")
- Blur = Instance.new("BlurEffect")
- Blur.Parent = game:GetService("Lighting")
- Blur.Size = 100
- GameUI.Parent = game.CoreGui
- QuestionFrame.Parent = GameUI
- QuestionFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- QuestionFrame.Position = UDim2.new(0.3, 0, 0.2, 0)
- QuestionFrame.Size = UDim2.new(0, 400, 0, 250)
- QuestionLabel.Name = "QuestionLabel"
- QuestionLabel.Parent = QuestionFrame
- QuestionLabel.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- QuestionLabel.Size = UDim2.new(0, 400, 0, 25)
- QuestionLabel.Font = Enum.Font.Arcade
- QuestionLabel.Text = "Teleport"
- QuestionLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- QuestionLabel.TextSize = 30
- QuestionFrameUICorner.Parent = QuestionFrame
- QuestionLabelUICorner.Parent = QuestionLabel
- TextLabel.Name = "TextLabel"
- TextLabel.Parent = QuestionFrame
- TextLabel.BackgroundTransparency = 1
- TextLabel.Position = UDim2.new(0.05, 0, 0.1, 0)
- TextLabel.Size = UDim2.new(0, 350, 0, 150)
- TextLabel.Font = Enum.Font.Arcade
- TextLabel.Text = "To play in 'My nightmare 4' you need to bee in special game. If you press on 'Yes' button you will teleport in this game, after that you need to re-execue script."
- TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel.TextSize = 30
- TextLabel.TextWrapped = true
- TextLabel.TextScaled = true
- TextLabelUICorner.Parent = TextLabel
- NoButton.Name = "NoButton"
- NoButton.Parent = QuestionFrame
- NoButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- NoButton.Position = UDim2.new(0.07, 0, 0.7, 0)
- NoButton.Size = UDim2.new(0, 125, 0, 50)
- NoButton.Font = Enum.Font.Arcade
- NoButton.Text = "No"
- NoButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- NoButton.TextScaled = true
- NoButton.TextSize = 14.000
- NoButton.TextWrapped = true
- NoButton.MouseButton1Down:connect(function()
- GameUI:Destroy()
- Blur.Size = 0
- end)
- NoButtonUICorner.Parent = NoButton
- YesButton.Name = "YesButton"
- YesButton.Parent = QuestionFrame
- YesButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- YesButton.Position = UDim2.new(0.6, 0, 0.7, 0)
- YesButton.Size = UDim2.new(0, 125, 0, 50)
- YesButton.Font = Enum.Font.Arcade
- YesButton.Text = "Yes"
- YesButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- YesButton.TextScaled = true
- YesButton.TextSize = 14.000
- YesButton.TextWrapped = true
- YesButton.MouseButton1Down:connect(function()
- TeleportService = game:GetService("TeleportService")
- PId = 337856574
- JobId = game.JobId
- if #game.Players:GetPlayers() <= 1 then
- game.Players.LocalPlayer:Kick("Teleporting...")
- wait()
- TeleportService:Teleport(PId, game.Players.LocalPlayer)
- else
- TeleportService:TeleportToPlaceInstance(PId, JobId, game.Players.LocalPlayer)
- end
- end)
- YesButtonUICorner.Parent = YesButton
- else
- if loaded then
- game.Players.LocalPlayer:Kick("Restart")
- TeleportService = game:GetService("TeleportService")
- Players = game:GetService("Players")
- LocalPlayer = Players.LocalPlayer
- local Rejoin = coroutine.create(function()
- local Success, ErrorMessage = pcall(function()
- TeleportService:Teleport(game.PlaceId, LocalPlayer)
- end)
- if ErrorMessage and not Success then
- warn(ErrorMessage)
- end
- end)
- coroutine.resume(Rejoin)
- end
- pcall(function()
- getgenv().loaded = true
- game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
- game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.Classic
- game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
- GameUI = Instance.new("ScreenGui")
- Static = Instance.new("ImageLabel")
- GameName = Instance.new("TextLabel")
- Part1 = Instance.new("Part")
- Cam = workspace.CurrentCamera
- Character = game.Players.LocalPlayer.Character
- Play = Instance.new("TextButton")
- Quit = Instance.new("TextButton")
- MenuSound = Instance.new("Sound")
- MainSound = Instance.new("Sound")
- StopGameButton = Instance.new("TextButton")
- HoverSound = Instance.new("Sound")
- Part2 = Instance.new("Part")
- GameUI.Parent = game.CoreGui
- Part1.Parent = workspace
- Part1.Anchored = true
- Part1.Size = Vector3.new(4, 1, 2)
- Part1.CanCollide = false
- Part1.Rotation = Vector3.new(0, 0, 0)
- Part1.Position = Vector3.new(128.94, 20.96, -333.17)
- Part1.Transparency = 1
- Part2.Parent = workspace
- Part2.Anchored = true
- Part2.Size = Vector3.new(4, 1, 2)
- Part2.CanCollide = false
- Part2.Rotation = Vector3.new(-19.91, -73.08, -1.23)
- Part2.Position = Vector3.new(-2.81, 2.86, 58.71)
- Part2.Transparency = 1
- MenuSound.Parent = game.Workspace
- MenuSound.SoundId = "rbxassetid://1844779909"
- MenuSound.Playing = true
- MenuSound.Looped = true
- MenuSound.Volume = 1
- MainSound.Parent = game.Workspace
- MainSound.SoundId = "rbxassetid://1837115475"
- MainSound.Playing = true
- MainSound.Looped = true
- MainSound.Volume = 1
- MainSound:Stop()
- HoverSound.Parent = game.Workspace
- HoverSound.SoundId = "rbxassetid://9120133107"
- HoverSound.Playing = true
- HoverSound.Looped = false
- HoverSound.Volume = 1
- HoverSound:Stop()
- Cam.CameraSubject = Part2
- Cam.CameraType = Enum.CameraType.Attach
- GameName.Parent = GameUI
- GameName.BackgroundTransparency = 1
- GameName.Size = UDim2.new(2, 0, 2, 0)
- GameName.Position = UDim2.new(-0.5, 0, -0.6 ,0)
- GameName.TextXAlignment = Enum.TextXAlignment.Center
- GameName.TextScaled = true
- GameName.Text = "My nightmare 4"
- GameName.TextColor3 = Color3.new(255, 255, 255)
- GameName.Font = Enum.Font.Arcade
- Play.Name = "Play"
- Play.Parent = GameUI
- Play.Position = UDim2.new(0.2, 0, 0.6 ,0)
- Play.Size = UDim2.new(0, 150, 0, 80)
- Play.Font = Enum.Font.Arcade
- Play.Text = "Play"
- Play.TextColor3 = Color3.fromRGB(255, 255, 255)
- Play.TextSize = 60
- Play.BackgroundColor3 = Color3.fromRGB(94, 54, 226)
- Play.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Play.BorderSizePixel = 5
- Play.AutoButtonColor = false
- Quit.Name = "Quit"
- Quit.Parent = GameUI
- Quit.Position = UDim2.new(0.6, 0, 0.6 ,0)
- Quit.Size = UDim2.new(0, 150, 0, 80)
- Quit.Font = Enum.Font.Arcade
- Quit.Text = "Quit"
- Quit.TextColor3 = Color3.fromRGB(255, 255, 255)
- Quit.TextSize = 60
- Quit.BackgroundColor3 = Color3.fromRGB(94, 54, 226)
- Quit.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Quit.BorderSizePixel = 5
- Quit.AutoButtonColor = false
- StopGameButton.Name = "StopGameButton"
- StopGameButton.Parent = GameUI
- StopGameButton.Position = UDim2.new(0.85, 0, 0.05 ,0)
- StopGameButton.Size = UDim2.new(0, 100, 0, 30)
- StopGameButton.Font = Enum.Font.Arcade
- StopGameButton.Text = "Stop"
- StopGameButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- StopGameButton.TextSize = 50
- StopGameButton.BackgroundColor3 = Color3.fromRGB(226, 54, 94)
- StopGameButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
- StopGameButton.BorderSizePixel = 5
- StopGameButton.Visible = false
- StopGameButton.AutoButtonColor = false
- Static.Parent = GameUI
- Static.Size = UDim2.new(1,0,1,100)
- Static.Position = UDim2.new(0,0,0,-100)
- Static.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Static.Image = "rbxassetid://13928716599"
- Static.Visible = false
- spawn(function()
- while wait(1) do
- StaticTime = math.random(1,3)
- if StaticTime == 1 then
- wait(1)
- Static.Visible = true
- wait()
- Static.Visible = false
- end
- if StaticTime == 2 then
- wait(5)
- Static.Visible = true
- wait()
- Static.Visible = false
- end
- if StaticTime == 3 then
- wait()
- Static.Visible = true
- wait()
- Static.Visible = false
- end
- end
- end)
- Play.MouseButton1Click:connect(function()
- Cam.CameraSubject = Part1
- Cam.CameraType = Enum.CameraType.Track
- GameName.Visible = false
- Play.Visible = false
- Quit.Visible = false
- MenuSound:Stop()
- MainSound:Play()
- StopGameButton.Visible = true
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(132, 20.96, -333.17)
- end)
- Quit.MouseButton1Click:connect(function()
- game.Players.LocalPlayer:Kick("Bye")
- end)
- StopGameButton.MouseButton1Click:connect(function()
- Cam.CameraSubject = Part1
- Cam.CameraType = Enum.CameraType.Attach
- GameName.Visible = true
- Play.Visible = true
- Quit.Visible = true
- MenuSound:Play()
- MainSound:Stop()
- StopGameButton.Visible = false
- end)
- Play.MouseEnter:Connect(function()
- Play.Size = UDim2.new(0, 160, 0, 90)
- HoverSound:Play()
- end)
- Play.MouseLeave:Connect(function()
- Play.Size = UDim2.new(0, 150, 0, 80)
- end)
- Quit.MouseEnter:Connect(function()
- Quit.Size = UDim2.new(0, 160, 0, 90)
- HoverSound:Play()
- end)
- Quit.MouseLeave:Connect(function()
- Quit.Size = UDim2.new(0, 150, 0, 80)
- end)
- StopGameButton.MouseEnter:Connect(function()
- StopGameButton.Size = UDim2.new(0, 110, 0, 40)
- HoverSound:Play()
- end)
- StopGameButton.MouseLeave:Connect(function()
- StopGameButton.Size = UDim2.new(0, 100, 0, 30)
- end)
- local Camera = workspace.CurrentCamera
- local Player = game.Players.LocalPlayer
- local Character = Player.Character
- local Root = Character:WaitForChild("HumanoidRootPart")
- local Neck = Character:FindFirstChild("Neck", true)
- local YOffset = Neck.C0.Y
- local CFNew, CFAng = CFrame.new, CFrame.Angles
- local asin = math.asin
- game:GetService("RunService").RenderStepped:Connect(function()
- local CameraDirection = Root.CFrame:toObjectSpace(Camera.CFrame).lookVector
- if Neck then
- if Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
- Neck.C0 = CFNew(0, YOffset, 0) * CFAng(0, -asin(CameraDirection.x), 0) * CFAng(asin(CameraDirection.y), 0, 0)
- elseif Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
- Neck.C0 = CFNew(0, YOffset, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(0, 0, -asin(CameraDirection.x)) * CFAng(-asin(CameraDirection.y), 0, 0)
- end
- end
- end)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement