Alief_Athallah

OnClicked_1 (Outfit Giver)

Oct 6th, 2020 (edited)
92
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 shirtID = script.Parent.Parent.OutfitGiver.Shirt.ShirtTemplate -- Shirt Template ID (Visit Category Group for some cool clothing) --
  5. local brick = script.Parent
  6.  
  7. click.MouseClick:Connect(function(player)
  8.     local shirt = player.Character:FindFirstChild("Shirt") -- Finding player shirt --
  9.     if not shirt then
  10.         print("Shirt was not found") -- Shirt not found in player --
  11.         local shirt2 = Instance.new("Shirt", player.Character) --- Creating new shirt in player --
  12.         shirt2.Name = "Shirt"
  13.         shirt2.ShirtTemplate = shirtID
  14.     else if shirt then
  15.             print("Shirt was found") -- Shirt found in player --
  16.             shirt.ShirtTemplate = shirtID
  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)
Add Comment
Please, Sign In to add comment