script.Parent.turn_tableCore.Touched:Connect(function(subject) if subject.Name == "turn_tableRight" then script.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.EnemyPart.Position) * CFrame.Angles(0, 0, math.rad(90))) print("touched") else end end)
This script, along with many other (function() scripts,are just not working. Any idea why?
Just add this at the bottom
script.Parent.turn_tableCore.Touched:Connect(subject)
and you're good to go!
script.Parent.turn_tableCore.Touched:Connect(function(subject) if subject.Name == "turn_tableRight" then script.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.EnemyPart.Position) * CFrame.Angles(0, 0, math.rad(90))) print("touched") else end end) script.Parent.turn_tableCore.Touched:Connect(subject)
this may be wrong due to this showing up "Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly." Because your question isn't really self-explanatory.
Personally I would put a script inside of the turn_tableCore that says
script.Parent.Touched:Connect(function(subject) if subject.Name == "turn_tableRight" then script.Parent.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.EnemyPart.Position) * CFrame.Angles(0, 0, math.rad(90))) print("touched") else end end)
or if you have to do it as inside of whatever then try adding print functions before the if function. I'm 90% sure it's to do with the
script.Parent.turn_tableCore
instead of that try doing
script.Parent["turn_tableCore"]Touched:Connect(function(subject)