I was scripting a small wave that comes out of the players hand, but the actual wave doesn't detect when it hits a player, though I used the get player service and touched connect.
01 | local Water = script.Parent |
02 |
03 |
04 | local function hurt(other) |
05 | local parent = other.Parent |
06 | if game.Players:GetPlayerFromCharacter(parent) then |
07 | parent.Humanoid.WalkSpeed = 10 |
08 | wait(. 8 ) |
09 | parent.Humanoid.WalkSpeed = 16 |
10 | wait(. 8 ) |
11 | Water:Destroy() |
12 | end |
13 |
14 | Water.Touched:Connect(hurt) |
15 |
16 | end |
Anyone know what's wrong?
Ok i dont know what you want or wher this is, but hers what i would do: (normalscript)
1 | Water.Touched:Connect( function (hit) |
2 | if hit.Parent:FindFirstChild( "Humanoid" ) or hit.Parent.Parent:FindFirstChild( "Humanoid" ) then |
3 | --i do hit.parent.parent in case it is a hat thats touched, or if hats dont count then take it out |
4 | hit.Parent.Humanoid.WalkSpeed = 10 |
5 | end |
6 | end ) |
and omg what is up with your code!? I understand but still im looking at it like https://youtu.be/ua-3T12Um7U?t=349 I mean, You do NOT need getplayerfromchracter player from other.parent and that stuff!