Touched not working on cloned items

If i clone a item via a serverscript from serverscriptservice or replicated storage, use .Touched on it, it doesn’t work.

local cloned = game.ReplicatedStorage.ItemClone:Clone()
cloned.Parent = workspace

cloned.Touched:Connect(function()
print("Hi")
end)

Furthermore, if I try using ZonePlus on it, it also doesnt work with the playerEntered and partEntered events.

Even if I put the script IN the cloned item so when its clone it runs, it doesn’t work

I am not sure why, any ideas?

I’m aware other topics like this have been made, I have viewed them and all of them seemed to be coding errors, this code is just fine though yet it wont work.

What is the base class of what you are trying to clone? If it is Model then Touched() wouldn’t work because… it doesn’t have one.

Clone() returns the cloned model, not also parenting it. Did you forget parenting the clone to Workspace?

No, it is a basepart. (charrrrrr)

Oh yes, I did parent it- sorry. It’s parented to workspace after.

Is that part has CanTouch set to true?

Yes, all it has is cancollide set to false. Canquery, cantouch, is true.

What does it show you inside the studio when you touched the part? Try this code.

local cloned = game.ReplicatedStorage.ItemClone:Clone()
cloned.Parent = workspace

cloned.Touched:Connect(function(otherPart)
        print(otherPart)
        print("Hi")
end)

Is there possibly by any chance a humanoid in workspace?

Okay so I found the problem.

It’s so weird.

If I send the part needing to be cloned via a remote event, and the variable is say partName, and i do local cloned = game.ReplicatedStorage:FindFirstChild(partName):Clone() touch doesnt work on it. If i directly reference it, touched works.

Idk how to fix this neither why this strange problem is happening, because I need to reference it via the variable.

How about try grouping it into a model.

No thats okay, I found a solution.

Instead of FindFirstChild I just did ReplicatedStorage[partName]|

Still. so strange.

That is weird. If it’s a server script, it should be in server storage though.

1 Like

I do agree with the post above, the tool should be saved in ServerStorage to prevent exploits that players can grab whatever they want inside the ReplicatedStorage. All items within ReplicatedStorage are accessible by both, so you must be careful. Making sure that you performs strict checking when using items inside ReplicatedStorage

Oh I know its just a part that has no significant value, either way thanks I am moving it to ss.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.