Essentially, there is a 1/5 chance that the PC finds the "vibro" item. Then there is a 1/5 chance that the PC finds the "adrenal" item instead.
If either item is found, the "rewardnum" becomes 100 or 101. Then a text box should display. However, the script is not working. No matter how many times I run it, the PC never finds the item.
What's going on?
Code:
plotscript, chest1, begin
###Declare variable###
variable (rewardnum)
variable (specialnum)
###chest to find items###
if (check tag (tag:vibro) == off) then (
specialnum := random (1,5)
if (specialnum == 1) then (rewardnum := 100)
) if (check tag (tag:adrenal) == off) then (
specialnum := random (1,5)
if (specialnum == 1) then (rewardnum := 101)
)
###items find###
) if (rewardnum == 100) then (
show text box (850)
get item (item:vibro, 1)
set default weapon (0,item:vibro)
) else if (rewardnum == 101) then (
show text box (1000)
set default weapon (0,item:adrenal)
force equip (0,slot:head,item:adrenal)
get item (item:adrenal, 1)
)
end
###Declare variable###
variable (rewardnum)
variable (specialnum)
###chest to find items###
if (check tag (tag:vibro) == off) then (
specialnum := random (1,5)
if (specialnum == 1) then (rewardnum := 100)
) if (check tag (tag:adrenal) == off) then (
specialnum := random (1,5)
if (specialnum == 1) then (rewardnum := 101)
)
###items find###
) if (rewardnum == 100) then (
show text box (850)
get item (item:vibro, 1)
set default weapon (0,item:vibro)
) else if (rewardnum == 101) then (
show text box (1000)
set default weapon (0,item:adrenal)
force equip (0,slot:head,item:adrenal)
get item (item:adrenal, 1)
)
end



