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
hit1 = script.Parent.Parent.GoalNet1.Hit
hit2 = script.Parent.Parent.GoalNet2.Hit
hit3 = script.Parent.Parent.GoalNet3.Hit
hit4 = script.Parent.Parent.GoalNet4.Hit
function onTouched(hit)
if hit.Name == "Ball" and hit1 == false and hit2 == false and hit3 == false and hit4 == false then
hit1 = true
hit2 = true
hit3 = true
hit4 = true
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "GOOOOOAAAAAAAAAAAAALLLLLLLLLLL!"
wait(5)
m:remove()
hit1 = false
hit2 = false
hit3 = false
hit4 = false
end
end
script.Parent.Touched:connect(onTouched)
