|
| 20 Feb 2016 11:47 PM |
p.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent.Name ~= script.Name then print(hit.Parent.Name) end end end)
Basically, I've named this script after the player who activated the Shot, but for some reason It won't active at all, regardless of who it hits.. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 11:51 PM |
you have you hit.parent:findFirstCild(Humanoid")then when it should be hit.Parent:FindFirstChild("players")then
you're attempting to get the name of the humanoid when the name of the humanoid is from the players and not from teh humanoid for the humanoid is in the gamespace and the players are just out of it onto the workspace |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 11:53 PM |
p.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Players") then if hit.Parent.Name ~= script.Name then print(hit.Parent.Name) end end end)
|
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 11:56 PM |
Why would 'Players' be within the Characters Model?
If I do that then it won't run at all because hit.Parnet:FindFirstChild("Players") does not even exist. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 11:59 PM |
P.Touched:connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") If hum then print(hum.Name) end) |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 12:00 AM |
| ... That would completely defeat the point of me renaming the Script after the Caster to avoid them being damaged by what they cast. |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 12:16 AM |
| your going to have to assign a value to the players vs the humanoid in order to make this cross over because the values of the players is the "Name" of the players, but yeah it wont be relevent to the character, its in the other place. |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2016 12:47 AM |
| When you touch a part its parent becomes a characters limb such as right arm or left arm so when you assign a variable such as local hum = hit.Parent which is the character you can find its child (humanoid) |
|
|
| Report Abuse |
|
|