Advertisement
Guest User

t0xz

a guest
Sep 16th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. ----------------------------Server Handler---------------------------
  2. local area_prices = {
  3.    
  4.     ["Area1"] = 1000,
  5.    
  6.     ["Area2"] = 1000,
  7.        
  8.     ["Area3"] = 1000,
  9.            
  10.     ["Area4"] = 1000,
  11.    
  12. }
  13.  
  14. local function purchase_area(player, area, gem)
  15.     if player and area and area_price[area] then
  16.         local stat
  17.         if gem == false then
  18.             stat = player.Data:WaitForChild("Coins")
  19.             if stat.Value >= area_price[area] then
  20.                 stat.Value = stat.Value - area_price[area]
  21.                 player.Data.Areas:FindFirstChild(area).Value = 1
  22.             end
  23.         else
  24.             stat = player.Data:WaitForChild("Gems")
  25.             if stat.Value >= area_price[area]/100 then
  26.                 stat.Value = stat.Value - area_price[area]/100
  27.                 player.Data.Areas:FindFirstChild(area).Value = 1
  28.             end
  29.         end
  30.     end
  31. end
  32.  
  33. local function tele(player, area)
  34.     if player and area then
  35.         if player.Data.Areas:FindFirstChild(area).Value == true then
  36.            
  37.         end
  38.     end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement