D
Dosko
Guest
Hello guys.
I want`t to ask you about shop and weapons.
I want the shop to buy weapons and ammunition.
Here, well, I am fine with the ammunition
But for weapons, it becomes more complicated.
I have written a script for changing them, which is most likely wrong.
The problem is that whenever I change them, they become active.
That's why my code in the shop is doing nothing but selecting the appropriate weapon.
Please, tell me where i`m wrong?
I want`t to ask you about shop and weapons.
I want the shop to buy weapons and ammunition.
Here, well, I am fine with the ammunition
Code:
if selected = 1 and global.p1_money >= 200
{
global.p1_money -= 200
global.uziammo += 10
}
if selected = 2 and global.p1_money >= 250
{
global.p1_money -= 250
global.akammo +=5
}
I have written a script for changing them, which is most likely wrong.
Code:
Player 1 Create
global.pistol = 1
global.uzi = 0
global.ak47 = 0
//
Player 1 Press B
if global.pistol = 1 {global.pistol = 0 global.ak47 = 1}
else if global.ak47 = 1 { global.aka47 = 0 global.uzi = 1}
else if global.uzi = 1 { global.uzi = 0 global.pistol = 1}
That's why my code in the shop is doing nothing but selecting the appropriate weapon.
Code:
if selected = 3 and global.p1_money >= 300
{
global.p1_money -= 300
global.uzi = 1
}