I made a tool that when you equip it, a shadow copy of it will appear, according to the mouse position.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local object = game.ReplicatedStorage.Tool.FirePit
event = game.ReplicatedStorage.RemoteEvent
script.Parent.Equipped:Connect(function()
local invisible = object:Clone()
invisible.Parent = workspace.CurrentCamera
invisible.CFrame = mouse.Hit
invisible.UsePartColor = true
invisible.CanCollide = false
while true do
wait(.01)
invisible.CFrame = mouse.Hit
mouse.Button1Down:Connect(function()
invisible:Destroy()
event:FireServer(mouse.Hit,object)
end)
end
end)
event:
local event = game.ReplicatedStorage.RemoteEvent
event.OnServerEvent:Connect(function(player,hit,object)
local clone = object:Clone()
clone.Parent = workspace
clone.CFrame = hit
clone.Fire.Enabled = true
clone.Transparency = 0
end)
It spawn up to thousands firepit, what should I do?

1 comment
Thanks