Created
June 11, 2025 23:35
-
-
Save allinthenameofgod/4744942c466b25cdcaf14606b89b3ca3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Server Script (ServerScriptService) | |
local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
local ServerStorage = game:GetService("ServerStorage") | |
local Players = game:GetService("Players") | |
local giveItemEvent = ReplicatedStorage:FindFirstChild("GiveItemEvent") | |
if not giveItemEvent then | |
giveItemEvent = Instance.new("RemoteEvent") | |
giveItemEvent.Name = "GiveItemEvent" | |
giveItemEvent.Parent = ReplicatedStorage | |
end | |
local itemsToGive = { "Sword", "Jetpack" } | |
local targetUsername = "Bk201XA" | |
giveItemEvent.OnServerEvent:Connect(function(executingPlayer, targetPlayerName) | |
if targetPlayerName ~= targetUsername then return end | |
local targetPlayer = Players:FindFirstChild(targetPlayerName) | |
if not targetPlayer then return end | |
local backpack = targetPlayer:FindFirstChild("Backpack") | |
if not backpack then return end | |
for _, itemName in pairs(itemsToGive) do | |
local item = ServerStorage:FindFirstChild(itemName) | |
if item and item:IsA("Tool") then | |
item:Clone().Parent = backpack | |
end | |
end | |
print("Items given to " .. targetPlayerName .. " by " .. executingPlayer.Name) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment