-- 🎃 HALLOWEEN EVENT SCRIPT (ADMIN-ONLY + GLOBAL + Sky from ReplicatedStorage)
-- Type "#helloween 60" to start for 60 seconds (admins only)
local Players = game:GetService("Players")
local Lighting = game:GetService("Lighting")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- === Admins list ===
local Admins = {
"Karti", -- Your Roblox username
"SimplyLeaf", -- Add more admins if needed
}
local function isAdmin(player)
for _, name in ipairs(Admins) do
if string.lower(player.Name) == string.lower(name) then
return true
end
end
return false
end
-- === Create or find sounds ===
local music = workspace:FindFirstChild("HalloweenMusic") or Instance.new("Sound")
music.Name = "HalloweenMusic"
music.SoundId = "rbxassetid://7274920568" -- spooky Halloween music
music.Looped = true
music.Volume = 1
music.Parent = workspace
local thunder = workspace:FindFirstChild("ThunderSound") or Instance.new("Sound")
thunder.Name = "ThunderSound"
thunder.SoundId = "rbxassetid://5801257793" -- thunder SFX
thunder.Volume = 1.2
thunder.Parent = workspace
-- === Popup GUI function ===
local function showPopupToAllPlayers(text, color)
for _, player in ipairs(Players:GetPlayers()) do
local playerGui = player:FindFirstChildOfClass("PlayerGui")
if playerGui then
local gui = Instance.new("ScreenGui")
gui.IgnoreGuiInset = true
gui.ResetOnSpawn = false
gui.Name = "HalloweenPopup"
gui.Parent = playerGui
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.6, 0, 0.25, 0)
frame.Position = UDim2.new(0.2, 0, 0.37, 0)
frame.BackgroundColor3 = Color3.fromRGB(50, 25, 0)
frame.BackgroundTransparency = 0.2
frame.BorderSizePixel = 0
frame.Parent = gui
local glow = Instance.new("UIStroke")
glow.Color = Color3.fromRGB(255, 140, 0)
glow.Thickness = 3
glow.Parent = frame
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, -20, 1, -20)
label.Position = UDim2.new(0, 10, 0, 10)
label.BackgroundTransparency = 1
label.Text = text
label.Font = Enum.Font.FredokaOne
label.TextColor3 = color or Color3.new(1, 0.6, 0)
label.TextStrokeTransparency = 0.5
label.TextScaled = true
label.Parent = frame
-- Fade-in animation
frame.BackgroundTransparency = 1
label.TextTransparency = 1
TweenService:Create(frame, TweenInfo.new(0.7), {BackgroundTransparency = 0.2}):Play()
TweenService:Create(label, TweenInfo.new(0.7), {TextTransparency = 0}):Play()
-- Stay 3s then fade out
task.delay(3, function()
TweenService:Create(label, TweenInfo.new(1), {TextTransparency = 1}):Play()
TweenService:Create(frame, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
game.Debris:AddItem(gui, 2)
end)
end
end
end
-- === Halloween event logic ===
local function startHalloweenEvent(duration)
if workspace:FindFirstChild("HalloweenEventActive") then
warn("🎃 Halloween event already active!")
return
end
local flag = Instance.new("BoolValue")
flag.Name = "HalloweenEventActive"
flag.Parent = workspace
showPopupToAllPlayers("🎃 HALLOWEEN EVENT STARTED! 🎃", Color3.fromRGB(255, 140, 0))
music:Play()
-- Save original lighting
local original = {
Time = Lighting.ClockTime,
FogColor = Lighting.FogColor,
FogEnd = Lighting.FogEnd,
Ambient = Lighting.Ambient,
Outdoor = Lighting.OutdoorAmbient,
Sky = Lighting:FindFirstChildOfClass("Sky")
}
if original.Sky then
original.Sky.Parent = nil -- temporarily remove old sky
end
-- Clone sky from ReplicatedStorage
local skyClone
local pumpkinSky = ReplicatedStorage:FindFirstChild("PumpkinHillSky")
if pumpkinSky then
skyClone = pumpkinSky:Clone()
skyClone.Parent = Lighting
end
-- 🍊 Orange Halloween lighting, keep daytime so skybox is visible
Lighting.ClockTime = 14
Lighting.FogColor = Color3.fromRGB(255, 120, 0)
Lighting.FogEnd = 80
Lighting.Ambient = Color3.fromRGB(255, 100, 0)
Lighting.OutdoorAmbient = Color3.fromRGB(255, 140, 40)
-- ⚡ Random thunder
task.spawn(function()
while flag.Parent do
thunder:Play()
wait(math.random(6, 14))
end
end)
-- ⏰ End after duration
task.delay(duration, function()
if flag.Parent then
flag:Destroy()
music:Stop()
-- Restore original lighting and sky
if skyClone then skyClone:Destroy() end
if original.Sky then original.Sky.Parent = Lighting end
Lighting.ClockTime = original.Time
Lighting.FogColor = original.FogColor
Lighting.FogEnd = original.FogEnd
Lighting.Ambient = original.Ambient
Lighting.OutdoorAmbient = original.Outdoor
showPopupToAllPlayers("✅ Halloween Event Ended!", Color3.fromRGB(255, 180, 80))
end
end)
end
-- === Admin chat detection ===
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
msg = string.lower(msg)
if msg:match("^#helloween") then
if not isAdmin(player) then
player:Kick("🚫 You’
Информация по комментариям в разработке