Advertisement
memecreater

Untitled

Oct 9th, 2022
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local function get_player(name: string): Player | nil
  4. name = name:lower()
  5.  
  6. for _, player in ipairs(Players:GetPlayers()) do
  7. if name == player.Name:lower():sub(1, #name) then
  8. return player
  9. end
  10. end
  11. return nil
  12. end
  13. local plr = (get_player(plyoeyy)
  14. local pmds = game.Workspace.PlayerModels
  15. local PlaceR = game.ReplicatedStorage.Interaction.DestroyStructure
  16. for i, v in pairs(pmds:GetChildren()) do
  17. if v:FindFirstChild("Owner") and v.Owner.Value ~= nil and v.Owner.Value == game.Players[plr] and v:FindFirstChild("ItemName") and v:FindFirstChild("Type") and (v.PrimaryPart ~= nil or v:FindFirstChild("MainCFrame")) then
  18. PlaceR:FireServer(v)
  19. end
  20. end
Tags: te st
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement