RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Create a script that gives new players who didn’t play before a wooden sword when they join"
-- server script (ServerScriptService) local Players = game:GetService("Players") local ServerStorage = game:GetService("ServerStorage") local woodenSword = ServerStorage.WoodenSword local function onPlayerAdded(player) local playerData = Instance.new("BoolValue") playerData.Name = "HasPlayedBefore" playerData.Parent = player if not playerData.Value then local backpack = player:WaitForChild("Backpack") local sword = woodenSword:Clone() sword.Parent = backpack playerData.Value = true end end Players.PlayerAdded:Connect(onPlayerAdded)