Hello,
So I’ve made an intro for my game following a tutorial a few days ago and works fine. The thing is that you can still walk while it plays. I was wondering if someone could help me so the player can’t move/freeze in the meantime and unfreeze at the end. It should be pretty simple but since I’m not a scripter…
The code inside the LocalScript:
local TweenService = game:GetService("TweenService")
local Player = game.Players.LocalPlayer
local RemoteEvent = game.ReplicatedStorage.IntroEvent
local intromusic = game.Workspace:FindFirstChild("intromusic")
local ScreenGui = script.Parent
local Frame = ScreenGui:WaitForChild("Frame")
local logo = Frame:WaitForChild("logo")
local presents = Frame:WaitForChild("presents")
local zailpark = Frame:WaitForChild("zailpark")
local warning = Frame:WaitForChild("warning")
local headphones = Frame:WaitForChild("headphones")
Frame.BackgroundTransparency = 0
local FrameInvisible = {}
local LogoVisible = {}
local LogoInvisible = {}
local PresentsVisible = {}
local PresentsInvisible = {}
local ZailParkVisible = {}
local ZailParkInvisible = {}
local WarningVisible = {}
local WarningInvisible = {}
local HeadphonesVisible = {}
local HeadphonesInvisible = {}
FrameInvisible.BackgroundTransparency = 1
LogoVisible.ImageTransparency = 0
LogoInvisible.ImageTransparency = 1
PresentsVisible.ImageTransparency = 0
PresentsInvisible.ImageTransparency = 1
ZailParkVisible.ImageTransparency = 0
ZailParkInvisible.ImageTransparency = 1
WarningVisible.ImageTransparency = 0
WarningInvisible.ImageTransparency = 1
HeadphonesVisible.ImageTransparency = 0
HeadphonesInvisible.ImageTransparency = 1
local Info = TweenInfo.new(2)
local STweenFrameInvisible = TweenService:Create(Frame,Info,FrameInvisible)
local STweenLogoVisible = TweenService:Create(logo,Info,LogoVisible)
local STweenLogoInvisible = TweenService:Create(logo,Info,LogoInvisible)
local STweenPresentsVisible = TweenService:Create(presents,Info,PresentsVisible)
local STweenPresentsInvisible = TweenService:Create(presents,Info,PresentsInvisible)
local STweenZailParkVisible = TweenService:Create(zailpark,Info,ZailParkVisible)
local STweenHeadphonesInvisible = TweenService:Create(headphones,Info,HeadphonesInvisible)
local faster = TweenInfo.new(0)
local FTweenWarningVisible = TweenService:Create(warning,faster,WarningVisible)
local FTweenWarningInvisible = TweenService:Create(warning,faster,WarningInvisible)
local FTweenHeadphonesVisible = TweenService:Create(headphones,faster,HeadphonesVisible)
local FTweenHeadphonesInvisible = TweenService:Create(headphones,faster,HeadphonesInvisible)
local FTweenZailParkInvisible = TweenService:Create(zailpark,faster,ZailParkInvisible)
RemoteEvent.OnClientEvent:Connect(function()
wait(6)
intromusic:Play()
STweenLogoVisible:Play()
wait(4)
STweenLogoInvisible:Play()
wait(0.2)
STweenPresentsVisible:Play()
wait(4)
STweenPresentsInvisible:Play()
wait(2)
STweenZailParkVisible:Play()
wait(4.7)
warning.ImageTransparency = 0
wait(7.3)
headphones.ImageTransparency = 0
wait(7.45)
headphones.ImageTransparency = 1
warning.ImageTransparency = 1
zailpark.ImageTransparency = 1
wait(7.4)
STweenFrameInvisible:Play()
script.Parent:Destroy()
end)
How would I go about get the player’s humanoid to then be able to change the WalkSpeed to 0 in the meantime? I’ve tried making an ontouch freeze brick and see what I could implement to the LocalScript from it but it didn’t really work out well, also checked the devforums but didn’t find any that was very helpful.