Ball OnTouched help?
Basically, whenever I put this script that I made into the nets it does not do what it is supposed to do, can you guys help? Basically, I want it to shout a message saying goal and enable it to where all the boolvalues in the goals would be true when a goal has happened, but it isn't showing anything in the error output and I have almost everything to see what is going on. If you could help me, that would be great.
v What I am putting the script into.
Link1
v is the ball going into the goal.
Link2
01 | hit 1 = script.Parent.Parent.GoalNet 1. Hit |
02 | hit 2 = script.Parent.Parent.GoalNet 2. Hit |
03 | hit 3 = script.Parent.Parent.GoalNet 3. Hit |
04 | hit 4 = script.Parent.Parent.GoalNet 4. Hit |
08 | function onTouched(hit) |
09 | if hit.Name = = "Ball" and hit 1 = = false and hit 2 = = false and hit 3 = = false and hit 4 = = false then |
14 | local m = Instance.new( "Message" ) |
15 | m.Parent = game.Workspace |
16 | m.Text = "GOOOOOAAAAAAAAAAAAALLLLLLLLLLL!" |
25 | script.Parent.Touched:connect(onTouched) |