- 16
- Posts
- 13
- Years
- Seen Dec 13, 2016
In this script I want to give the player a key item that allows him to change back and forth from the costume to the default whenever it gets used. However, when I try to toggle a switch by using $game_switches to accomplish this, nothing happens to the switch.
Here's my code:
the variable is the player's gender, and the switch controls if the new outfit is on or not.
By all means, I think that it should be working properly, but I don't know why its not. I'm on essentials 16.2
Here's my code:
Spoiler:
def pbPoliceUniform
if $game_variables[27]==0 and !$game_switches[62]
pbChangePlayer(2)
$game_switches[62]==true
return 1
end
if $game_variables[27]==1 and !$game_switches[62]
pbChangePlayer(2)
$game_switches[62]==true
return 1
end
if $game_variables[27]==1 and $game_switches[62]
pbChangePlayer(1)
!$game_switches[62]
return 2
end
if $game_variables[27]==0 and $game_switches[62]
pbChangePlayer(0)
!$game_switches[62]
return 2
end
end
ItemHandlers::UseFromBag.add(:POLICEUNIFORM,proc{|item| pbPoliceUniform
})
if $game_variables[27]==0 and !$game_switches[62]
pbChangePlayer(2)
$game_switches[62]==true
return 1
end
if $game_variables[27]==1 and !$game_switches[62]
pbChangePlayer(2)
$game_switches[62]==true
return 1
end
if $game_variables[27]==1 and $game_switches[62]
pbChangePlayer(1)
!$game_switches[62]
return 2
end
if $game_variables[27]==0 and $game_switches[62]
pbChangePlayer(0)
!$game_switches[62]
return 2
end
end
ItemHandlers::UseFromBag.add(:POLICEUNIFORM,proc{|item| pbPoliceUniform
})
the variable is the player's gender, and the switch controls if the new outfit is on or not.
By all means, I think that it should be working properly, but I don't know why its not. I'm on essentials 16.2