Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
  2. script.Parent.MouseButton1Down:Connect(function()
  3. local store = game.ReplicatedStorage:WaitForChild("Tools")
  4. local sel = store:WaitForChild(script.Parent.Parent.Name)
  5. if player:FindFirstChild("Tools") and player.Tools:FindFirstChild(script.Parent.Parent.Name) and player.Tools[script.Parent.Parent.Name].Value == true then
  6. player:WaitForChild("ToolEquiped").Value = script.Parent.Parent.Name
  7. player.Tools[script.Parent.Parent.Name].Value = true
  8. else
  9. local stats = player:WaitForChild("leaderstats")
  10. local coins = stats:WaitForChild("Coins")
  11. if coins.Value >= sel:WaitForChild("Price").Value then
  12. player.Tools[script.Parent.Parent.Name].Value = true
  13. player:WaitForChild("ToolEquiped").Value = script.Parent.Parent.Name
  14. end
  15. end
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement