Auto-translated
Most likely, you made a mistake in the script – I suspect that the computer is giving your player 10 crystals because that's exactly how you wrote it ;)
Share the source code :)
function regF()
SetAmbientLight (0, "Tu", true, 5);
ChangeResource (1, 5, 10);
end;
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "reg", "regF");