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)

1 comment

0

Edited for code block. Please use the code block feature (the Lua icon) to place your text into Lua syntax.