Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How come this script for a water blast isn't detecting players?

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.

local Water = script.Parent


 local function hurt(other)
	local parent = other.Parent
	if game.Players:GetPlayerFromCharacter(parent) then
	 parent.Humanoid.WalkSpeed = 10
	wait(.8)
	parent.Humanoid.WalkSpeed = 16
	wait(.8)
	Water:Destroy()
end

Water.Touched:Connect(hurt)

end

Anyone know what's wrong?

2 comments

0

Im not so sure cause im new but i think instead of hurt it should mean something that kills the player or takes out health points??

0

oh yeah

1 answer

✓ Accepted answer

Ok i dont know what you want or wher this is, but hers what i would do: (normalscript)

Water.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then
--i do hit.parent.parent in case it is a hat thats touched, or if hats dont count then take it out
hit.Parent.Humanoid.WalkSpeed = 10
end
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!

2 comments

0

oh, well, thanks! Ill see if it works

0

and sorry for my code being a mess of me trying to mix my code and a youtubers, i just now realized how much more simpler i can code things.

This discussion is preserved as it was. New answers, comments, and votes are closed.