I've explored multiple scripts. But the NumberValue, fifa, will not change when the soccerball hits this part.
Here's my latest script:
script.Parent.Touched:connect(function(hit) if hit.Name == "HumanoidRootPart" or hit.Name == "Handle" or hit.Name == "Right Leg" or hit.Name == "Left Leg" or hit.Name == "Torso" or hit.Name == "Head" or hit.Name == "Right Arm" or hit.Name == "Left Arm" then game.Workspace.fifa.Value = workspace.fifa.Value+1 end end)
Thank you for your time in advance!
It looks like the score only goes up when a Character
touches the part the script is located in. If you're trying to get a point to score when a soccer ball touches the goal, you'll need to change up the script.
I've demonstrated below what you need to change in order to get this to work. Place the following script inside a part in the goal, and change the soccerName
value to the name of your soccer ball part.
local soccerName = "Ball" -- Change this value to the name of your soccer ball part. script.Parent.Touched:connect(function(hit) if hit.Name == soccerName then game.Workspace.fifa.Value = workspace.fifa.Value+1 end end)
Make sure to accept if I helped! :)