ok, so I have filtering enabled and Im trying to make a destroy part script with a pickaxe. Heres the localScript,
local swing = script.Parent.Swing
local db = 5
oof = false
event = game:GetService("ReplicatedStorage").BlockBreak
script.Parent.Activated:Connect(function()
if not oof then
oof = true
local plr = game.Players.LocalPlayer
local Char = workspace:WaitForChild(plr.Name)
print(Char)
if Char ~= nil then
local animTrack = Char.Humanoid:LoadAnimation(swing)
animTrack:Play()
db = 6
wait(0.8)
db = 5
end
wait(5)
oof = false
end
end)
script.Parent.Handle.Touched:Connect(function(hit)
if db == 6 then
local naa = hit.Parent:FindFirstChild("HitTag")
if naa ~= nil then
event:FireServer(naa:GetFullName(),hit.Parent:GetFullName())
end
end
end)
And ServerScript:
event = game:GetService("ReplicatedStorage").BlockBreak
event.OnServerEvent:Connect(function(plr,bVal,name)
loc = name
loc2 = bVal
print("Recieved Order from "..plr.Name.." to break ".. loc)
if loc ~=nil then
wait(1)
name.Parent = nil
print("Logged")
loc.Parent:Destroy()
end
end)
The problem is that name is a string, how would I turn it into a directory so I can destroy the part?
