- Home /
Question by
dreadt9 · Dec 19, 2012 at 07:52 AM ·
weaponcustomizationneed
Weapon Customizations Script Problem
Hey, I made this uncompleted script but for some reason for switching my primary weapons its not working the way I want it to, Please Help, Thanks
var currentPrimary = "Galil";
var currentSecoundary = "Desert Eagle";
function Start () {
}
function Update () {
}
function OnGUI () {
GUI.Label (Rect (Screen.width / 3 + 130, Screen.height / 3, 125, 25), "Primary Weapon");
GUI.TextArea (Rect (Screen.width / 3 + 130, Screen.height / 3 + 25, 125, 25), currentPrimary, 25);
if ( GUI.Button (Rect (Screen.width / 3 + 50, Screen.height / 3 + 25, 25, 25), "<") ) {
if ( currentPrimary == "Galil" ) {
currentPrimary = "UMP-45";
}
if ( currentPrimary == "UMP-45" ) {
currentPrimary = "Spas-12";
}
if ( currentPrimary == "Spas-12" ) {
currentPrimary = "Galil";
}
}
if ( GUI.Button (Rect (Screen.width / 3 + 325, Screen.height / 3 + 25, 25, 25), ">") ) {
if ( currentPrimary == "Galil" ) {
currentPrimary = "Spas-12";
}
if ( currentPrimary == "UMP-45" ) {
currentPrimary = "Galil";
}
if ( currentPrimary == "Spas-12" ) {
currentPrimary = "UMP-45";
}
}
// ----------------------
GUI.Label (Rect (Screen.width / 3 + 130, Screen.height / 3 + 55, 125, 25), "Secoundary Weapon");
GUI.TextArea (Rect (Screen.width / 3 + 130, Screen.height / 3 + 80, 125, 25), currentSecoundary, 25);
if ( GUI.Button (Rect (Screen.width / 3 + 50, Screen.height / 3 + 80, 25, 25), "<") ) {
}
if ( GUI.Button (Rect (Screen.width / 3 + 325, Screen.height / 3 + 80, 25, 25), ">") ) {
}
// ----------------------
GUI.TextArea (Rect (Screen.width / 3, Screen.height / 4, 500, 300), "Weapon Customisation", 25);
}
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Whats wrong with this 2 Answers
Need Help with a play Animation script. 1 Answer
Creating a weapon script. Need Help / advice. 1 Answer
My imported weapon flips around. 1 Answer