local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Mouse.Button1Down:Connect(function() local par = Instance.new("Part",workspace) if workspace:FindFirstChild(par) then print("ie") else print("nope") end end)
This prints "nope" everytime. But if I switch it to findfirstchild("Part") then it works.
IS there a fix for this?
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() Mouse.Button1Down:Connect(function() local par = Instance.new("Part",workspace) if workspace:FindFirstChild(par.Name) then print("ie") else print("nope") end end)
As someone else (@fredfishy) mentioned the FindFirstChild functions receives a string as an input and outputs the first object with the name of the input, however you input the object instead.
Keep in mind that this piece of code will find the first part that comes with that name, so i'm guessing that you're trying to stop it from doing something if there's already a part.