oonqi

studio button

Nov 26th, 2021
4,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. script 1
  2.  
  3. local NoDuplicates = true
  4. local WaitTime = .05
  5. local PartName = 'ExamplePart' -- you can change this name to whatever you'd like
  6.  
  7. local rStorage,Players,Debounce = game:GetService('ReplicatedStorage'),game:GetService('Players'),false
  8. local pClone = rStorage:WaitForChild(PartName):Clone()
  9.  
  10. script.Parent.Touched:Connect(function(Part)
  11. if Debounce then return end
  12. Debounce = true
  13. local Rig = Part.Parent
  14. if Rig:FindFirstChildOfClass('Humanoid') and Players:FindFirstChild(Rig.Name) then
  15. if NoDuplicates then
  16. if workspace:FindFirstChild(pClone.Name) then return end
  17. end
  18. pClone:Clone().Parent = workspace
  19. end
  20. wait(WaitTime)
  21. Debounce = false
  22. end)
  23.  
  24. ---------
  25. script 2
  26.  
  27. local part = script.Parent
  28. function Atingere()
  29. Game.Workspace.pillow.Parent = Game.ServerStorage -- edit 'pillow' to whatever your part/model name is
  30. script.Parent.BrickColor = BrickColor.new ("Hot pink") -- you can change this color to whatever you'd like
  31. end
  32. script.Parent.Touched:Connect(Atingere)
Advertisement
Add Comment
Please, Sign In to add comment