This is from another scene I made. It resets User Data by inserting values when a button is clicked on. The button then resets. This code works. Why is the other code I posted not working?
import c4d
def main():
ID_RESET_Classic_Beer = 29
ID_RESET_Cool_Pop = 412
ID_RESET_Dew = 413
ID_RESET_Fridge = 414
ID_RESET_Summer = 415
ID_RESET_Mountain = 416
ID_RESET_Cooler = 417
ID_RESET_Picnic = 418
ID_RESET_Heat_Wave = 419
ID_RESET_Drive_in = 420
ID_PRESET = 13
rig = op.GetObject()
# reset Classic Beer
if rig[c4d.ID_USERDATA, ID_RESET_Classic_Beer]:
rig[c4d.ID_USERDATA, ID_RESET_Classic_Beer] = False
rig[c4d.ID_USERDATA, 196] = 0 # Classic Beer MASTER Coalesce
rig[c4d.ID_USERDATA, 197] = 1 # Classic Beer Coalesce Amount
rig[c4d.ID_USERDATA, 198] = 1 # Classic Beer BIG and SMALL Random Scale
rig[c4d.ID_USERDATA, 199] = 3 # Classic Beer Mesh Density
rig[c4d.ID_USERDATA, 201] = 1 # Classic Beer BIG Drops
rig[c4d.ID_USERDATA, 202] = 500 # Classic Beer BIG Amount
rig[c4d.ID_USERDATA, 203] = 3 # Classic Beer BIG Size
rig[c4d.ID_USERDATA, 204] = 26085 # Classic Beer Random Seed BIG
rig[c4d.ID_USERDATA, 206] = 1 # Classic Beer SMALL Drops
rig[c4d.ID_USERDATA, 207] = 800 # Classic Beer SMALL Amount
rig[c4d.ID_USERDATA, 208] = 1.6 # Classic Beer SMALL Size
rig[c4d.ID_USERDATA, 209] = 24338 # Classic Beer Random Seed SMALL
rig[c4d.ID_USERDATA, 211] = 1 # Classic Beer MICRO Drops
rig[c4d.ID_USERDATA, 212] = 2000 # Classic Beer MICRO Amount
rig[c4d.ID_USERDATA, 213] = 3 # Classic Beer MICRO Size
rig[c4d.ID_USERDATA, 214] = .18 # Classic Beer MICRO Strength
rig[c4d.ID_USERDATA, 215] = 28643 # Classic Beer RANDOM Seed MICRO
rig[c4d.ID_USERDATA, 190] = 0 # Classic Beer MIST Off On
rig[c4d.ID_USERDATA, 191] = 1000 # Classic Beer MIST Amount
rig[c4d.ID_USERDATA, 192] = 1 # Classic Beer MIST Droplet Size
rig[c4d.ID_USERDATA, 193] = 12345 # Classic Beer Random Seed MIST
rig[c4d.ID_USERDATA, 194] = 2 # Classic Beer Random Scale MIST
c4d.EventAdd()