HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to Make a Piggy Game Part 2: Start Screen And Doors

18,114 views July 5, 2020 15:54

Watch on YouTube
ChannelCornFake

Description from the creator

screen gui local script:
local camera = workspace.CurrentCamera
local playBtn = script.Parent.PlayBtn

repeat
wait()
camera.CameraType = Enum.CameraType.Scriptable
print(camera.CameraType)
until camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = workspace.CameraFocusPart.CFrame

playBtn.MouseButton1Click:Connect(function()
camera.CameraType = Enum.CameraType.Custom
script.Parent:Destroy()
end)

Door Script:
local door = script.Parent.Door
local closePlaceHolder = script.Parent.DoorClosed
local openPlaceHolder = script.Parent.DoorOpened
local clickDetector = door.ClickDetector
local closeSound = door.Close
local openSound = door.Open

local debounce = true
local isOpened = false

local info = TweenInfo.new(0.3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local closedProperties = {CFrame = closePlaceHolder.CFrame}
local openProperties = {CFrame = openPlaceHolder.CFrame}
local closeTween = game.TweenService:Create(door, info, closedProperties)
local openTween = game.TweenService:Create(door, info, openProperties)

clickDetector.MouseClick:Connect(function()
if debounce then
debounce = false
if not isOpened then
openSound:Play()
openTween:Play()
else
closeSound:Play()
closeTween:Play()
end
isOpened = not isOpened
wait(1)
debounce = true
end
end)

Game Link: web.roblox.com/games/340975715/How-To-Make-A-Pi…

Thank You For Watching Part 2 It Was More Fast Then I Tought So Yea Cya Guys In The Next Vid! Ciao Guys!

About this tutorial

CornFake published this 15:54 video tutorial on July 5, 2020. It has been watched 18,114 times on YouTube.

Channel
CornFake
Category
Gaming
Duration
15:54
Published
July 5, 2020
Views
18,114
Likes
261

Share

This tutorial in other languages