Simply the code literally doesn’t run. It could be located somewhere where scripts don’t run (like outside of Workspace and ServerScriptService) or it’s Disabled.
Not sure then. I’d try restarting studio and double checking the things I wrote above. You can also send a place file with just that script and the parts and I can give it a go.
local goal1 = workspace.goal1
goal1.Touched:Connect(function(part)
if part.Name == "Ball" then
print("Blue scored a goal")
game.ReplicatedStorage.BlueGoals.Value = game.ReplicatedStorage.BlueGoals.Value + 1
Ball.Position = originalPosition
Ball.Anchored = true
wait(2)
Ball.Anchored = false
end
end)
Needs to be a server script, place it in workspace. Also the part named “goal1” must be named “goal1” as seen in explorer, same with “Ball” that part must also be named “Ball” as seen in explorer.
I think what he means is put more prints in strategic places so you know what it IS doing. 1) before the function is even called, 2) after touched is fired but before any other logic
if print#1 doesn’t work your script isn’t running
if print#2 doesn’t work your touched isn’t firing
The script isn’t even running, and it is in the ServerScriptService and is not disabled, so i am going to completely remake the game. Thanks for the help!