Forum Discussion
Text Entry-Three Fields
- 3 months ago
I played around and found out: there is a curly bracket missing at the end of your numpad scripts. Any script error will disable all scripts from working.
var player = GetPlayer();
var DCID_Ongoing = player.GetVar("DCID_Ongoing");
var DCIDInput = player.GetVar("DCIDInput");
var DriverID_Ongoing = player.GetVar("DriverID_Ongoing");
var DriverIDInput = player.GetVar("DriverIDInput");
var TractorNum_Ongoing = player.GetVar("TractorNum_Ongoing");
var TractorNumInput = player.GetVar("TractorNumInput");
if (DCID_Ongoing == true) {
DCIDInput += "0";
player.SetVar("DCIDInput", DCIDInput);
} else if (DriverID_Ongoing == true) {
DriverIDInput += "0";
player.SetVar("DriverIDInput", DriverIDInput);
} else if (TractorNum_Ongoing == true) {
TractorNumInput += "0";
player.SetVar("TractorNumInput", TractorNumInput);
} //<-- This is the bracket you missed.For your testing, disable all other scripts. Fix one of them. If it works, copy to and enable others back on. Inspect the console on the preview panel helps you figure out what could be wrong :)
Once they are all set, you can add your original backspace and clear buttons back. I didn't try them because I am lazy. It just changes one line of code.
Hi Jesse,
Thank you SO much! This is genius! I got started based on your example, and despite doing it the exact same way, my numbers won't appear. Can you look at this updated one and see what I'm missing?
I played around and found out: there is a curly bracket missing at the end of your numpad scripts. Any script error will disable all scripts from working.
var player = GetPlayer();
var DCID_Ongoing = player.GetVar("DCID_Ongoing");
var DCIDInput = player.GetVar("DCIDInput");
var DriverID_Ongoing = player.GetVar("DriverID_Ongoing");
var DriverIDInput = player.GetVar("DriverIDInput");
var TractorNum_Ongoing = player.GetVar("TractorNum_Ongoing");
var TractorNumInput = player.GetVar("TractorNumInput");
if (DCID_Ongoing == true) {
DCIDInput += "0";
player.SetVar("DCIDInput", DCIDInput);
} else if (DriverID_Ongoing == true) {
DriverIDInput += "0";
player.SetVar("DriverIDInput", DriverIDInput);
} else if (TractorNum_Ongoing == true) {
TractorNumInput += "0";
player.SetVar("TractorNumInput", TractorNumInput);
} //<-- This is the bracket you missed.
For your testing, disable all other scripts. Fix one of them. If it works, copy to and enable others back on. Inspect the console on the preview panel helps you figure out what could be wrong :)
Once they are all set, you can add your original backspace and clear buttons back. I didn't try them because I am lazy. It just changes one line of code.
- StefanieKirs7433 months agoCommunity Member
Jesse THANK YOU THANK YOU so so much!!!!