Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Humanoid = script.Parent:FindFirstChild("Humanoid")
- local UserInputService = game:GetService("UserInputService")
- local Key = Enum.KeyCode.T
- local Lighting = game.Lighting
- local Step = 0.1
- local TweenWaitTime = 0.05
- local Holding = false
- local TweenService = game:GetService("TweenService")
- local MyTweenInfo = TweenInfo.new(TweenWaitTime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
- local ChangeTime_Properties = {ClockTime = Lighting.ClockTime + Step}
- local ChangeTime_TweenAnimation = TweenService:Create(Lighting, MyTweenInfo, ChangeTime_Properties)
- UserInputService.InputBegan:Connect(function(Input)
- if Input.KeyCode == Key then
- Holding = true
- while Holding == true and wait() do
- ChangeTime_Properties = {ClockTime = Lighting.ClockTime + Step}
- ChangeTime_TweenAnimation = TweenService:Create(Lighting, MyTweenInfo, ChangeTime_Properties)
- ChangeTime_TweenAnimation:Play()
- end
- end
- end)
- UserInputService.InputEnded:Connect(function(Input)
- if Input.KeyCode == Key then
- Holding = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement