Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Workspace = game:GetService("Workspace")
- local function giveExampleItems(player)
- -- Create PlayerStorage if it doesn't exist
- local storage = player:FindFirstChild("PlayerStorage")
- if not storage then
- storage = Instance.new("Folder")
- storage.Name = "PlayerStorage"
- storage.Parent = player
- end
- -- Example: Give the player a Note and a Table (if they exist in Workspace)
- local note = Workspace:FindFirstChild("Note")
- if note and not storage:FindFirstChild("Note") then
- local noteClone = note:Clone()
- noteClone.Parent = storage
- end
- local tableModel = Workspace:FindFirstChild("Table")
- if tableModel and not storage:FindFirstChild("Table") then
- local tableClone = tableModel:Clone()
- tableClone.Parent = storage
- end
- end
- Players.PlayerAdded:Connect(function(player)
- giveExampleItems(player)
- end)
- -- For studio test: handle players already in game
- for _, player in Players:GetPlayers() do
- giveExampleItems(player)
- end
Advertisement
Add Comment
Please, Sign In to add comment