Advertisement
qsenko1

all pets iterating not what i wanted but cool!

Jun 23rd, 2021
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. PetsFrameEvent.OnClientEvent:Connect(function(Index) -- when the remote event on the server fires 15 times for no reason it receives the info in here once and i wanted it once:P,but thats a small but i need to figure out in future!!
  2.     if debounce then
  3.        
  4.     local Player = game:GetService("Players").LocalPlayer
  5.            
  6.     for i,v in pairs(MainFrame:GetDescendants())do
  7.             --v:GetChildren()
  8.             --print(v)
  9.            
  10.             if v:IsA("ImageButton") and v.Name == "PetsButton" then --  or v:IsA("StringValue") and v.Name == "PetIndex" or v:IsA("IntValue") and v.Name == "Price"                
  11.             debounce = false   
  12.             --if v.Name == "PetsButton" then   
  13.                 --v:GetChildren()
  14.                 print(v)
  15.                 --if v.Name == "PetsName"  then
  16.                 --local Pets = PetsFolder:GetChildren()
  17.                 --print(Pets)
  18.                 --print(PetName.Value)
  19.                 --if PetName.Value == Pets.Name then
  20.                 local Frame = player:FindFirstChild("PlayerGui"):FindFirstChild("PetsPurchaseGui"):FindFirstChild("BuyPet")    
  21.                 local FrameInfo = Frame:FindFirstChild("Desc")
  22.                 local PetName = v:FindFirstChild("PetIndex").Value
  23.                 local PetPrice = v:FindFirstChild("Price").Value
  24.                 --PetName = v.Name.Text
  25.                 wait()
  26.                 FrameInfo.Text = "Are you Sure you want to buy this " .. PetName .. " for " .. PetPrice .. " Coins"
  27.                 print(PetName)
  28.                 Frame:TweenPosition(
  29.                     UDim2.new(0.499, 0,0.494, 0),-- End Position       
  30.                     "Out", -- Easing Direction
  31.                     "Linear", -- Easing Style
  32.                     .5 -- Time in Seconds
  33.                 )  
  34.                
  35.             Frame.Visible = true                   
  36.         --  end
  37.         end
  38.     end
  39.     wait(2)
  40.     --print("it works!!")
  41.         debounce = true
  42.     end
  43. end)
  44. --https://gyazo.com/8900f47e3406fc06c681b9bc770478e0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement