i am slowly making my way to creating a FE compatible gun. i started off with a basic block that when you click, drops a block right on the ground. it works perfectly, the only problem is, when i unequip and equip my tool, it drops an extra part. the server script is located in serverScriptService. the localscript is located in the tool itself. here are my scripts.
LocalScript:
local plr = script.Parent.Parent.Parent
local tool = script.Parent
local Handle = tool.Handle
local mouse = plr:GetMouse()
tool.Equipped:connect(function()
mouse.Button1Down:connect(function()
game.ReplicatedStorage.RemoteEvent:FireServer()
end)
end)
Server Script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:connect(function(plr)
local tool = plr.Character.Tool
local Handle = tool.Handle
local Part = Instance.new("Part", game.Workspace)
Part.CFrame = Handle.CFrame
wait(3)
Part:Destroy()
end)
here is what happens when it adds another part: here is what happens when it adds another part
