DragonYTPastesWork

Load Script

Aug 12th, 2020 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. game.ReplicatedStorage.LoadBuild.OnServerEvent:Connect(function(player)
  2.     local s,e = pcall(function()
  3.         local build = BuildsDataStore:GetAsync(player.UserId)
  4.         for i, tab in pairs(build) do
  5.             local block = Instance.new("Part",workspace)
  6.             block.Name = "BuiltBlock"
  7.             block.Position.X = tonumber(tab.Position.X)
  8.             block.Position.Y = tonumber(tab.Position.Y)
  9.             block.Position.Z = tonumber(tab.Position.Z)
  10.             block.Size = tonumber(tab.Size)
  11.             block.Material = tab.Material
  12.             block.BrickColor = tab.Color
  13.         end
  14.     end)
  15.     if s then
  16.         print("Successfully loaded build!")
  17.     elseif not s and e then
  18.         print("Not successful: "..e)
  19.     end
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment