Advertisement
Alief_Athallah

OnClicked_2 (Outfit Giver)

Oct 6th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. -- Script by AliefAthallah --
  2.  
  3. local click = script.Parent:WaitForChild("ClickDetector")
  4. local pantsID = script.Parent.Parent.OutfitGiver.Pants.PantsTemplate -- Pants Template ID (Visit Category Group for some cool clothing) --
  5. local brick = script.Parent
  6.  
  7. click.MouseClick:Connect(function(player)
  8.     local pants = player.Character:FindFirstChild("Pants") -- Finding player Pants --
  9.     if not pants then
  10.         print("Pants was not found") -- Pants not found in player --
  11.         local pants2 = Instance.new("Pants", player.Character) --- Creating new Pants in player --
  12.         pants2.Name = "Pants"
  13.         pants2.PantsTemplate = pantsID
  14.     else if pants then
  15.             print("pants was found") -- Pants found in player --
  16.             pants.PantsTemplate = pantsID
  17.         end
  18.     end
  19. end)
  20.  
  21. function OnEnter()
  22.     brick.BrickColor = BrickColor.new("Lime green") -- Mouse Enter changing the brick color --
  23. end
  24.  
  25. function OnLeave()
  26.     brick.BrickColor = BrickColor.new("Medium stone grey") -- Mouse Leave changing the brick color --
  27. end
  28.  
  29. click.MouseHoverEnter:Connect(OnEnter)
  30. click.MouseHoverLeave:Connect(OnLeave)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement