このコードは、ヘルスが 0 になるとオブジェクトを破棄しますが、global.xp 変数に 5/7 を追加しません。
if rotem_hp > 1 and shop_13 = 0
{
rotem_hp = rotem_hp -1
}
else
{
if rotem_hp > 1 and shop_13 = 1 rotem_hp = rotem_hp -1.5
if rotem_hp < 1 and shop_4 = 0 global.xp = global.xp + 5 instance_destroy()
if rotem_hp < 1 and shop_4 = 1 global.xp = global.xp + 7 instance_destroy()
}
これもうまくいかない
if (rotem_hp > 1 and global.shop_13 = 0)
{
rotem_hp = rotem_hp -1
}
else if (rotem_hp > 1 and global.shop_13 = 1)
{
rotem_hp = rotem_hp -1.5
}
else if (rotem_hp < 1 and global.shop_4 = 0)
{
global.xp = global.xp +5
instance_destroy()
}
else if (rotem_hp < 1 and global.shop_4 = 1)
{
global.xp = global.xp +7
instance_destroy()
}
else
{
//do nothing
}
これはオブジェクトを破壊しません(ところで、私が持っている作成イベントでは(rotem_hp = 5)
if rotem_hp > 1 and global.shop_13 = 0
{
rotem_hp = rotem_hp -1
}
if rotem_hp > 1 and global.shop_13 = 1
{
rotem_hp = rotem_hp -1.5
}
if rotem_hp < 1 and global.shop_4 = 0
{
global.xp = global.xp +5
instance_destroy()
}
if rotem_hp < 1 and global.shop_4 = 1
{
global.xp = global.xp +7
instance_destroy()
}
私の質問に答える努力に感謝します。