xgamexfreakx
Member
Ok. I just have two simple questions..... I am just learning how to script and am trying to make a simple mining script. I need to know how to add an item to the players inventory with scripting and how to call my script. I know my script may not be the most efficient, but like I said, I am just learning. Could anyone know how to call this script through an event???? (Go up to the rock and use the action key.....) Thanks!!! :thumb:
Code:
class Mine
def main
coal = rand(10)
end
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
update
end
def update
self.contents.clear
if coal > 7
self.contents.draw_text(0, 0, 200, 32, "Mined Coal!")
else
if coal > 3
self.contents.draw_text(0, 0, 200, 32, "Darn, no coal to be found.")
else
self.contents.draw_text(0, 0, 200, 32, "You miss, but you try again.")
main
end
end
end
end