Advertisement
ZeroCool5254

Roblox Clothes giver

Nov 16th, 2017
3,450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 KB | None | 0 0
  1. -- Uniform Giver
  2. -- Gullet
  3. -- 2015/02/01
  4.  
  5. -- Tags --
  6.  
  7. local pantsId = script.Parent.Parent.Pants.Pants.PantsTemplate
  8. local cPart = script.Parent
  9. local cDetector = script.Parent.ClickDetector
  10. local left = script.Parent.Parent.Pants["Left Leg"]
  11. local right = script.Parent.Parent.Pants["Right Leg"]
  12. amnt = 5
  13.  
  14.  
  15. -- Functions --
  16.  
  17. local function onClicked(player)
  18.     print(player.Name.." clicked on Uniform Giver")
  19.    
  20.    
  21.     local foundPants = player.Character:FindFirstChild("Pants") -- Tries to find Pants
  22.     if not foundPants then -- if there are no pants
  23.         print("No pants found, creating for "..player.Name)
  24.         local newPants = Instance.new("Pants",player.Character)
  25.         newPants.Name = "Pants"
  26.     else if foundPants then -- if there are pants
  27.         print("Pants found, reconstructing for "..player.Name)
  28.         player.Character.Pants:remove()
  29.         local newPants = Instance.new("Pants",player.Character)
  30.         newPants.Name = "Pants"
  31.    
  32.         wait(1)
  33.         script.Parent.CFrame = script.Parent.CFrame*CFrame.new(0,-50,0)
  34.         left.Transparency = 1
  35.         right.Transparency = 1
  36.         wait(amnt)
  37.         script.Parent.CFrame = script.Parent.CFrame*CFrame.new(0,50,0)
  38.         left.Transparency = 0
  39.         right.Transparency = 0
  40.     end
  41.     end
  42.  
  43.     player.Character.Pants.PantsTemplate = pantsId
  44.     end
  45.  
  46.  
  47. --local function onHoverEnter(player)
  48.     --cPart.SurfaceGui.Frame.ImageLabel.Visible = true
  49. --end
  50.  
  51.  
  52. --local function onHoverLeave(player)
  53.     --cPart.SurfaceGui.Frame.ImageLabel.Visible = false
  54. --end
  55.  
  56.  
  57. -- Binds --
  58.  
  59. --cDetector.MouseHoverEnter:connect(onHoverEnter)
  60. --cDetector.MouseHoverLeave:connect(onHoverLeave)
  61. cDetector.MouseClick:connect(onClicked)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement