Cosmoaxis
(Cosmoaxis)
February 1, 2021, 4:52pm
1
I made it so the spell prints whatever it hits, however it detects the character, but not any other object.
The touched script is:
script.Parent.Touched:Connect(function(hit)
print(hit.Name)
end)
That is inside the spell part. Any reply would be appreciated, thanks.
Edit: The output didn’t show for some reason
1 Like
script.Parent.Touched:Connect(function(hit)
print(hit.Name.Parent)
end)
try that
How are you cloning the script into the part? If you do it through a local script then the script won’t even run because the server doesn’t recognize that the script is there.
lluckvy
(aaron)
February 1, 2021, 5:02pm
4
Try using hit.Parent.Name
because hit.Name
will probably show the body part of the character, not the character itself
script.Parent.Touched:Connect(function(hit)
print(hit.Parent.Name)
end)
nakoyasha
(Haruka)
February 1, 2021, 5:16pm
5
.Touched
does not fire for anchored parts
croblarx
(croblarx)
February 1, 2021, 5:33pm
6
Because the handle of the tool is welded to your hand so that’s why it’s detecting it.
Maybe a check to see if it’s ur character…
script.Parent.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) == nil then
print(hit.Name)
end
end)
Cosmoaxis
(Cosmoaxis)
February 1, 2021, 6:07pm
7
I went for tea, I’m going to try out all of these, @RealExoctic I believe that to be the issue
Jxl_s
(Jxl_s)
February 1, 2021, 8:46pm
8
Are you sure that the part can collide and the part is not anchored?