There is a couple of things that I can see wrong with this code that could be causing the script not to work. First of all it looks like you are running this code in a LocalScript in workspace. The problem with this is that LocalScripts don’t run in workspace. The other problem I can see is that you haven’t defined ice anywhere so that could be causing something to error.
It would be nice to know what your specific use cause for this would be. When do specifically need to know the magnitude of the part and the player? Is this script or a LocalScript and where is it located? Is this the full code? Knowing this information will help use give you a better answer and we may be able to give you a better solution to what you are trying to achieve.
In the future could you please follow the scripting support guidelines when creating new topics because it is really hard to just fix a script with very limited information: