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

made this placement system it places exactly at the mouseray position only 1 can place not multiple?

Asked by
YODARM 5
4 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

this is my script

local gp = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local grass = game.ReplicatedStorage:WaitForChild("Grass"):Clone()

if gp.Equipped then
    mouse.Button1Down:Connect(function()
        local mouseRay = mouse.UnitRay
        local castRay = Ray.new(mouseRay.Origin, mouseRay.Direction * 1000)
        local hit, position = workspace:FindPartOnRay(castRay)

        if script.Parent.PlaceAmountValue.Value >= 0 then
            grass.Parent = game.Workspace
            grass.Position = hit.Position 
        end
    end)
end

Answer this question