Guest User

Untitled

a guest
Jul 27th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local Workspace = game:GetService("Workspace")
  4.  
  5. local function giveExampleItems(player)
  6. -- Create PlayerStorage if it doesn't exist
  7. local storage = player:FindFirstChild("PlayerStorage")
  8. if not storage then
  9. storage = Instance.new("Folder")
  10. storage.Name = "PlayerStorage"
  11. storage.Parent = player
  12. end
  13.  
  14. -- Example: Give the player a Note and a Table (if they exist in Workspace)
  15. local note = Workspace:FindFirstChild("Note")
  16. if note and not storage:FindFirstChild("Note") then
  17. local noteClone = note:Clone()
  18. noteClone.Parent = storage
  19. end
  20.  
  21. local tableModel = Workspace:FindFirstChild("Table")
  22. if tableModel and not storage:FindFirstChild("Table") then
  23. local tableClone = tableModel:Clone()
  24. tableClone.Parent = storage
  25. end
  26. end
  27.  
  28. Players.PlayerAdded:Connect(function(player)
  29. giveExampleItems(player)
  30. end)
  31.  
  32. -- For studio test: handle players already in game
  33. for _, player in Players:GetPlayers() do
  34. giveExampleItems(player)
  35. end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment