I am trying to make a sword and am trying to make it detect when ever it touches a part. It works but I am trying to make it only happen when I click and so far, after I click it once, it will always print. Here is local script for the tool.
local mouse = game.Players.LocalPlayer:GetMouse()
local db = true
script.Parent.Equipped:Connect(function()
mouse.Button1Down:Connect(function()
if db == true then
script.Parent.sword_event:FireServer()
db = false
wait(0.1)
db = true
end
end)
end)
I don't think there is any problems with it and I think my server script is causing all the problems
local event = script.Parent.OnServerEvent:Connect(function(player)
local tool = game.Workspace[player.Name].Tool
tool.Handle.Touched:Connect(function(part)
if part.Parent == game.Workspace[player.Name] then
print("e")
else
print("r")
end
end)
end)
Please help me!
