script:-- 🌮 Raining Tacos Global + Private Event System
-- Works in Roblox Studio & Studio Lite by theyluvjay
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")
-- Folder name & music name in ReplicatedStorage
local folderName = "DevTalk"
local musicName = "RainingTacosMusic"
-- Admin list
local Admins = {
["sixbossoky"] = true,
["AnotherAdminName"] = true
}
-- Keep track of global and private events
local activeGlobalEvent = nil
local activeGlobalMusic = nil
local privateEvents = {}
-- Function: Start Global Event
local function startGlobalEvent(player)
if activeGlobalEvent then
warn("⚠ Global event already running.")
return
end
local folder = ReplicatedStorage:FindFirstChild(folderName)
if folder then
activeGlobalEvent = folder:Clone()
activeGlobalEvent.Parent = workspace
print("🌎 Global event started by " .. player.Name)
else
warn("⚠ Folder '" .. folderName .. "' not found in ReplicatedStorage.")
end
-- Play global music
local music = ReplicatedStorage:FindFirstChild(musicName)
if music and music:IsA("Sound") then
activeGlobalMusic = music:Clone()
activeGlobalMusic.Parent = SoundService
activeGlobalMusic.Looped = true
activeGlobalMusic.Volume = 1
activeGlobalMusic:Play()
print("🎵 Global music started.")
else
warn("⚠ Sound '" .. musicName .. "' not found in ReplicatedStorage.")
end
end
-- Function: Stop Global Event
local function stopGlobalEvent(player)
if activeGlobalEvent then
activeGlobalEvent:Destroy()
activeGlobalEvent = nil
print("🛑 Global event stopped by " .. player.Name)
else
warn("⚠ No global event running.")
end
if activeGlobalMusic then
activeGlobalMusic:Stop()
activeGlobalMusic:Destroy()
activeGlobalMusic = nil
print("🔇 Global music stopped.")
end
end
-- Function: Start Private Event (only the admin sees it)
local function startPrivateEvent(player)
if privateEvents[player] then
warn(player.Name .. " already has a private event running.")
return
end
local folder = ReplicatedStorage:FindFirstChild(folderName)
if folder then
local cloned = folder:Clone()
cloned.Parent = player:FindFirstChild("PlayerGui") or player:WaitForChild("PlayerGui")
privateEvents[player] = {folder = cloned}
print("🔒 Private event started for " .. player.Name)
else
warn("⚠ Folder '" .. folderName .. "' not found in ReplicatedStorage.")
end
local music = ReplicatedStorage:FindFirstChild(musicName)
if music and music:IsA("Sound") then
local musicClone = music:Clone()
musicClone.Parent = player:FindFirstChild("PlayerGui") or player:WaitForChild("PlayerGui")
musicClone.Looped = true
musicClone.Volume = 1
musicClone:Play()
privateEvents[player].music = musicClone
print("🎧 Private music started for " .. player.Name)
end
end
-- Function: Stop Private Event
local function stopPrivateEvent(player)
local data = privateEvents[player]
if data then
if data.folder then
data.folder:Destroy()
end
if data.music then
data.music:Stop()
data.music:Destroy()
end
privateEvents[player] = nil
print("🔕 Private event stopped for " .. player.Name)
else
warn(player.Name .. " has no private event running.")
end
end
-- Handle admin chat commands
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
message = string.lower(message)
if not Admins[player.Name] then return end
-- Global Commands
if message == "/event dev global" then
startGlobalEvent(player)
elseif message == "/stop dev global" then
stopGlobalEvent(player)
-- Private Commands
elseif message == "/event dev private" then
startPrivateEvent(player)
elseif message == "/stop dev private" then
stopPrivateEvent(player)
end
end)
end)