-
Trying to put a click detector in a part that is in a player.
-
The click detector will not destroy the part when clicked, this is inside of a player so could that cause it?
print("yes")
script.Parent:Destroy()
end)
Trying to put a click detector in a part that is in a player.
The click detector will not destroy the part when clicked, this is inside of a player so could that cause it?
print("yes")
script.Parent:Destroy()
end)
is this yes printings also could you show more of the code
Also, is this a localscript? how are you checking if its destroyed? It may be destroyed on the client but not on the server. (or reversed)
Provided you have the ClickDetector object inside the Part, can you try this?
--This should be inside the Part
local Part = script.Parent
local ClickDetector = Part:WaitForChild("ClickDetector")
local PartToFind = "PartNameHere"
local function Clicked(Player)
local Char = Player.Character
if Char and Char:FindFirstChild(PartToFind) then
Char[PartToFind]:Destroy()
end
end
ClickDetector.MouseClick:Connect(Clicked)
It would help us if you could provide more details on what’s currently happening when you click it