I really just want to improve this.
-- \\ Player-Related Variables // --
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HUM = Character:WaitForChild("Humanoid")
-- \\ Variables // --
local Randomzier = Random.new()
local Meditation1 = false
local GUIS = script.Parent
local Circle = GUIS.MovingCircle
local White = Color3.fromRGB(255, 255, 255)
-- \\ Services/Service-Related Variables // --
local UIS = game:GetService("UserInputService")
local Debris = game:GetService("Debris")
local TW = game:GetService("TweenService")
local RS = game:GetService("ReplicatedStorage")
local Med = RS:FindFirstChild("Meditation")
local MouseLoc = UIS:GetMouseLocation()
local Lighting = game:GetService("Lighting") -- Instance that will be Tweened
local TweenService = game:GetService("TweenService") -- Service that allows us to use Tweens
local Particle = RS.ParticleEmitters.lsls:Clone()
Particle.CFrame = Humrp.CFrame * CFrame.new(0, 2 , 0)
local Weld = Instance.new("ManualWeld")
Weld.Part0 = Particle
Weld.Part1 = Humrp
-- \\ Animation-Related Variables //--
local Anim = script.Meditation
-- \\ Functions // --
GUIS.IgnoreGuiInset = true
UIS.InputBegan:Connect(function(Input, Processed, IsTyping)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local OGTP = TweenInfo.new(
2,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.Out,
0,
false,
1
)
local TP = TweenInfo.new(
5,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.Out,
-1,
true,
1
)
local OGGoals = {
Density = 0.3,
Offset = 0.25,
Decay = Color3.fromRGB(106, 112, 125),
Glare = 0,
Haze = 0,
}
local OGGoals2 = {
FarIntensity = 0.104,
FocusDistance = 4.16,
NearIntensity = 0.75
}
local Goals = {
Density = 0.613,
Offset = 0.081,
Decay = Color3.fromRGB(175, 185, 206),
Glare = 0.32,
Haze = 2.26
}
local Goals2 = {
FarIntensity = 0.5,
FocusDistance = 0,
NearIntensity = 0.35
}
---------------------------------------------------------------------------
local TWAtmo = TweenService:Create(Lighting.Atmosphere, TP, Goals)
local TWBlur = TweenService:Create(Lighting.DepthOfField, TP, Goals2)
local OGTWAtmo = TweenService:Create(Lighting.Atmosphere, OGTP, OGGoals)
local OGTWBlur = TweenService:Create(Lighting.DepthOfField, OGTP, OGGoals2)
local MedAnim = Character.Humanoid.Animator:LoadAnimation(Anim)
----------------------------------------------------------------------------
if Meditation1 == true then return end
if not IsTyping then
if Input.KeyCode == Enum.KeyCode.M then
if GUIS.Enabled == false then
GUIS.Enabled = true
Circle.MouseEnter:Connect(function()
if Meditation1 == false then
Meditation1 = true
HUM.WalkSpeed = 0
--local PR = RS.Sit:Clone()
local function TweenDone(state)
if state == Enum.TweenStatus.Completed and Meditation1 == true then
RS.Progressing:FireServer("MeditationTraining")
print("Yeah we good")
else
return
end
end
--print("We working")
MedAnim:Play()
MedAnim.Looped = true
TWAtmo:Play()
TWBlur:Play()
Part = Instance.new("Part",workspace)
Part.Size = Vector3.new(2048, 16, 2048)
Part.Position = Vector3.new(0, 333, 0)
Part.Transparency = 1
Part.Massless = true
Part.Anchored = true
Part.Name = "It's Raining outside..."
local Emitter = Instance.new("ParticleEmitter", Part)
Emitter.Rate = 700
Emitter.Lifetime = NumberRange.new(2, 5)
Emitter.Size = NumberSequence.new(0.8,2)
Emitter.Color = ColorSequence.new{
ColorSequenceKeypoint.new(0, White),
ColorSequenceKeypoint.new(1, White)
}
Emitter.SpreadAngle = Vector2.new(-360, 360)
Emitter.Acceleration = Vector3.new(0, -60, 0)
--print("Pocket full of ducks")
--PR.Parent = Humrp
while GUIS.Enabled do
task.wait(1)
script.Parent.MovingCircle:TweenPosition(UDim2.new(Randomzier:NextNumber(0, 0.962),46 ,Randomzier:NextNumber(0, 0.285),47), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, math.random(5,8), false, TweenDone)
task.wait(3)
Particle.Parent = workspace
TWAtmo:Pause()
TWBlur:Pause()
end
end
end)
Circle.MouseLeave:Connect(function()
MedAnim:Stop()
TWAtmo:Cancel()
TWBlur:Cancel()
OGTWAtmo:Play()
OGTWBlur:Play()
Part:Destroy()
GUIS.Enabled = false
HUM.WalkSpeed = 16
Meditation1 = false
end)
end
end
end
end)