So I have this part that is created with this script
local Player = game.Players.localPlayer game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:wait() plr.Character:WaitForChild("Torso") local torso = plr.Character.Torso local part = Instance.new("Part", game.Workspace) part.Transparency = 1 part.CanCollide = false part.Size = Vector3.new(7,7,7) game.Lighting.Find:Clone().Parent = part part:FindFirstChild("Find").Disabled = false part.Anchored = true while wait(0.025) do part.CFrame = CFrame.new(torso.Position) end end)
and whenever the part touches another part I want it this script (located in the part created above) to fire its function
while wait(0.1) do script.Parent.Touched:connect(function(hit) local found = hit:FindFirstChild("ItemName") if found then print(found.Parent.Name) end end) end
for some reason it doesn't work and its not the collision either
First off, remove the local player line, and move the first script into a normal script, and move it to server script service,
Then remove the while wait loop, it's useless, and inefficient.
Finally, make sure ItemName is actually a child of the correct part, and that it's capitalization is correct.