Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I have working build script I want to add resources but how ?

Asked by 5 years ago
Edited by M39a9am3R 5 years ago

I have working build script... I want to add resources (Stone = 2 Stones) But i dont know how to do It someone please help

script:

local rs = game.ReplicatedStorage
local event = rs.GrassPlace

function place(plr,target,blockType)
    if blockType == "Stone" then
        local newBlock = Instance.new("Part", workspace)
        newBlock.Size = Vector3.new(4,4,4)
        newBlock.Anchored = true
        newBlock.Material = Enum.Material.Concrete
        newBlock.BrickColor = BrickColor.Gray()
        newBlock.Name = "BuiltBlock"
        newBlock.CFrame = CFrame.new(target.Position) + Vector3.new(0,4,0)
          end
    if blockType == "Wood" then
        local newBlock = Instance.new("Part", workspace)
        newBlock.Size = Vector3.new(4,4,4)
        newBlock.Anchored = true
        newBlock.Material = Enum.Material.Brick
        newBlock.BrickColor = BrickColor.palette(1)
        newBlock.Name = "BuiltBlock"
        newBlock.CFrame = CFrame.new(target.Position) + Vector3.new(0,4,0)
    end
end

event.OnServerEvent:connect(place)
0
Edited for code block. Please use the code block feature (the Lua icon) to place your text into Lua syntax. M39a9am3R 3210 — 5y

Answer this question