Rayd12smitty
Shadow Maker
- 645
- Posts
- 12
- Years
- Seen Feb 21, 2016
Hey guys. I am extremely new to scripting and am experimenting with different things by making custom scripts. I am working on making a PWT script. So since I am a noob, I am having trouble with a few basic commands. I have figured out a lot with Carmaniac's help and by looking through the existing scripts. There are two things I haven't figured out that I need right now and am hoping someone can tell me how.
1. I want to set a variable to a random number between 1 and 8. I am currently using this but am not sure if it is the right way or if it is working right.
2. I understand how to call a sprite to the screen like this:
I want to make it so that the number in the filename (1) depends on a variable, the same one from above. I have looked at existing scripts and tried copying them but I keep getting errors.
Can someone show me how to do these 2 things?
1. I want to set a variable to a random number between 1 and 8. I am currently using this but am not sure if it is the right way or if it is working right.
Code:
$game_variables[84]=rand(1-8)
2. I understand how to call a sprite to the screen like this:
Code:
@sprites["Player Box"] = Sprite.new
@sprites["Player Box"].z = 2
@sprites["Player Box"].x = 0
@sprites["Player Box"].y = 0
@sprites["Player Box"].bitmap = RPG::Cache.picture("PWTBox1")
I want to make it so that the number in the filename (1) depends on a variable, the same one from above. I have looked at existing scripts and tried copying them but I keep getting errors.
Can someone show me how to do these 2 things?