Advertisement
giganciprogramowania

l18 localscript

Jan 5th, 2024
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local player = game.Players.LocalPlayer
  2. local button = player.PlayerGui:WaitForChild("ScreenGui").Center.PetInventory.Upgrade
  3. local napis = button.Parent.DamageLabel
  4. local oldBackground = button.BackgroundColor3
  5.  
  6. button.MouseButton1Click:Connect(function ()
  7.     local damage = player.Values.Damage.Value
  8.     local cost = 10*(2^(damage-1))
  9.     if player.leaderstats.Shards.Value >= cost then
  10.      damage +=1
  11.      game.ReplicatedStorage.Remotes.Upgrade:FireServer(cost, damage)
  12.      button.Text = "Purchased!"
  13.      button.BackgroundColor3=Color3.new(0.0352941, 0.52549, 0.00392157)
  14.      napis.Text = "Your dmg multiplier: x" .. damage
  15.      wait(2)
  16.      cost = 10*(2^(damage-1))
  17.      button.Text = "Upgrade for " .. cost .. " Shards"
  18.      button.BackgroundColor3=oldBackground
  19.     else
  20.      button.Text = "Not enough Shards!"
  21.      button.BackgroundColor3=Color3.new(0.52549, 0.0156863, 0.0862745)
  22.      wait(2)
  23.      button.Text = "Upgrade for " .. cost .. " Shards"
  24.      button.BackgroundColor3=oldBackground
  25.     end
  26. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement