-- Server Script (ServerScriptService or ServerScript)
-- Create RemoteEvent
local fireEvent = Instance.new("RemoteEvent")
fireEvent.Name = "FireEvent"
fireEvent.Parent = game:GetService("ReplicatedStorage") -- ReplicatedStorage is
used for storing objects that need to be replicated to all clients
-- Function to handle firing effect
local function fireOnPlayers()
-- Get all players in the game
local players = game:GetService("Players"):GetPlayers()
-- Loop through each player and apply the "fire" effect
for _, player in ipairs(players) do
-- Perform fire effect on each player (example: teleport them to a fire
location, damage them, etc.)
-- Replace this with your desired fire effect
print("Firing on player:", player.Name)
-- Example: teleport player to a fire location
-- local fireLocation = Vector3.new(0, 100, 0) -- Example fire location
-- player.Character:MoveTo(fireLocation)
end
end
-- Listen for RemoteEvent triggered by clients
fireEvent.OnServerEvent:Connect(function(player)
fireOnPlayers() -- Call the function to fire on all players
end)
-- Client Script (LocalScript)
-- Locate where your ScreenGui creation code is and add this LocalScript
-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "CustomGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Function to make the ScreenGui draggable
local function makeDraggable(frame)
local dragging = false
local dragInput, mousePos, framePos
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
mousePos = input.Position
framePos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - mousePos
frame.Position = UDim2.new(
framePos.X.Scale,
framePos.X.Offset + delta.X,
framePos.Y.Scale,
framePos.Y.Offset + delta.Y
)
end
end)
end
-- Create the main frame (ScreenGui)
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.5, 0, 0.4, 0) -- Adjusted size to be larger
frame.Position = UDim2.new(0.25, 0, 0.3, 0) -- Adjusted position to center
frame.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
frame.BorderSizePixel = 5
frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
frame.Parent = screenGui
makeDraggable(frame)
-- Create the "Open" button to show the ScreenGui
local openButton = Instance.new("TextButton")
openButton.Size = UDim2.new(0.2, 0, 0.1, 0)
openButton.Position = UDim2.new(0.4, 0, 0.85, 0)
openButton.Text = "Open"
openButton.Parent = screenGui
openButton.MouseButton1Click:Connect(function()
frame.Visible = true
openButton.Visible = false -- Hide the Open button when frame is open
closeButton.Visible = true -- Show the Close button when frame is open
end)
-- Create the "Close" button to hide the ScreenGui
local closeButton = Instance.new("TextButton")
closeButton.Size = UDim2.new(0.2, 0, 0.1, 0)
closeButton.Position = UDim2.new(0.6, 0, 0.85, 0)
closeButton.Text = "Close"
closeButton.Visible = false -- Initially hide Close button
closeButton.Parent = screenGui
closeButton.MouseButton1Click:Connect(function()
frame.Visible = false
openButton.Visible = true -- Show the Open button when frame is closed
closeButton.Visible = false -- Hide the Close button when frame is closed
end)
-- Create the "Fire" button to fire on all players
local fireButton = Instance.new("TextButton")
fireButton.Size = UDim2.new(0.2, 0, 0.1, 0)
fireButton.Position = UDim2.new(0.4, 0, 0.7, 0)
fireButton.Text = "Fire on All Players"
fireButton.Parent = screenGui
fireButton.MouseButton1Click:Connect(function()
fireEvent:FireServer() -- Fire the RemoteEvent to all clients
end)
-- Create the "k00lkidd81 laugh" button
local laughButton = Instance.new("TextButton")
laughButton.Size = UDim2.new(0.8, 0, 0.1, 0)
laughButton.Position = UDim2.new(0.1, 0, 0.1, 0)
laughButton.Text = "k00lkidd81 laugh"
laughButton.Parent = frame
laughButton.MouseButton1Click:Connect(function()
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://18475341140"
sound.Parent = game.Workspace
sound:Play()
end)
-- Create the "Day to Night" button
local dayNightButton = Instance.new("TextButton")
dayNightButton.Size = UDim2.new(0.8, 0, 0.1, 0)
dayNightButton.Position = UDim2.new(0.1, 0, 0.25, 0)
dayNightButton.Text = "Day to Night"
dayNightButton.Parent = frame
dayNightButton.MouseButton1Click:Connect(function()
local lighting = game:GetService("Lighting")
if lighting.ClockTime >= 6 and lighting.ClockTime < 18 then
lighting.ClockTime = 18
else
lighting.ClockTime = 6
end
end)
-- Create the "Play Music" button
local musicButton = Instance.new("TextButton")
musicButton.Size = UDim2.new(0.8, 0, 0.1, 0)
musicButton.Position = UDim2.new(0.1, 0, 0.4, 0)
musicButton.Text = "Play Music"
musicButton.Parent = frame
musicButton.MouseButton1Click:Connect(function()
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://18431141543"
sound.Parent = game.Workspace
sound:Play()
end)
-- Create the "Hint" label at the top of the screen
local hintLabel = Instance.new("TextLabel")
hintLabel.Size = UDim2.new(0.3, 0, 0.05, 0)
hintLabel.Position = UDim2.new(0.35, 0, 0, 0)
hintLabel.BackgroundTransparency = 1
hintLabel.TextColor3 = Color3.new(1, 1, 1)
hintLabel.TextStrokeTransparency = 0
hintLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
hintLabel.TextScaled = true
hintLabel.TextWrapped = true
hintLabel.Font = Enum.Font.SourceSans
hintLabel.Text = "Hacked by k00lkidd81"
hintLabel.Visible = false
hintLabel.Parent = screenGui
-- Create the "Message" label at the top of the screen
local messageLabel = Instance.new("TextLabel")
messageLabel.Size = UDim2.new(0.3, 0, 0.05, 0)
messageLabel.Position = UDim2.new(0.35, 0, 0.05, 0)
messageLabel.BackgroundTransparency = 1
messageLabel.TextColor3 = Color3.new(1, 1, 1)
messageLabel.TextStrokeTransparency = 0
messageLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
messageLabel.TextScaled = true
messageLabel.TextWrapped = true
messageLabel.Font = Enum.Font.SourceSans
messageLabel.Text = "Hacked by k00lkidd81"
messageLabel.Visible = false
messageLabel.Parent = screenGui
-- Update hint and message visibility based on ScreenGui visibility
frame:GetPropertyChangedSignal("Visible"):Connect(function()
local isVisible = frame.Visible
hintLabel.Visible = isVisible
messageLabel.Visible = isVisible
end)