Can you describe what you want your script tool to do? A description of the tool's function may assist in getting an answer to your question.
I would suggest that you do some testing of the code before putting it in a script tool. This will help debug the script as error messages will display and help pinpoint the source of the problem.
I've retyped your code as Dan Patterson has suggested (using the syntax highlighter). This format will give some line numbers to aid in the discussion.
import arcpy, math, os
arcpy.env.workspace = arcpy.GetParameter(0)
arcpy.env.overwriteOutput = True
ParemListFea = arcpy.GetParameter(1)
ParemSpat = arcpy.GetParameter(2)
try:
SpatRef = ParemSpat
SelectMob = arcpy.SelectLayerByAttribute_management(MobFeat, "NEW_SELECTION", "nom = '1105'")
ComMob = arcpy.GetCount_management(SelectMob)
MobFeat = "Mobilier_Urbain_L"
OutMob = "Mobilier0"
OutTempMob = "MobilierTemp"
Dbf_Mob = "Mobilier_Urbaine_L.dbf"
OutTxt_Mob = "Mobilier_U_L.txt"
if ListFeatIn == "Mobilier_Urbain_L.shp" and ComMob > 0:
arcpy.TableToTable_conversion(Dbf_mob, arcpy.env.workspace, OutTxt_Mob)
arcpy.MakeXYEventLayer_management(OutTxtMob, FieldX1, FieldY1, OutTempMob, ParemSpat, FieldZ1)
arcpy.FeatureClassToFeatureClass_conversion(OutTempMob, arcpy.env.workspace, OutMob)
From the code snippet above, I notice that several variables are referenced before they are defined.
In line 9, MobFeat is being referenced, but it is not defined until line 12. Perhaps line 12 should be moved before line 9 ?
And in line 17 the value of ListFeatIn is being checked to see if it matches the name of a shape file. Perhaps ListFeatIn is supposed to be ParemListFea ? I do not see a reference to ParemListFea being used later in the script.
Line 17 also references ConMob. This value will be zero or None if the SelectLayerByAttibute fails at line 9. The where clause in line 9 is referencing a field nom and checking for a certain text string '1105' that may be a number 1105. This will affect what is being returned by the query.
These are just a few quick observations. Please tell us more about your project.