Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Make an item appear after smashing plates?
xxxxxxxxxxxxxxxx Away
Posting Freak

Posts: 935
Threads: 0
Joined: Jun 2012
Reputation: 54
#7
RE: Make an item appear after smashing plates?

Quote: Now I just need to break it down and learn what certain things do. Like the whole local variable thing confuses me a lot :/
Well a local variable is just that - a variable. Big Grin It has a name and a value - the name always stays the same, but the value can change. So basically it let's the script "remember" a value for later use.

One of it's most basic uses is counting things. So in this case, you create a variable that shall count the number of broken plates:
VarInt means that the variable is an integer, or a whole number. (like 1,2,5...), BrokenPlates is the name and 0 is the start value.

The if statement later on then simply uses AddLocalVarInt to add 1 to the variable every time a plate is broken. It also says that if the number of broken plates is 5 (which means, the variable BrokenPlates has a value of 5), the key shall appear. And that's pretty much the whole magic behind this Smile
(This post was last modified: 04-19-2013, 10:16 AM by xxxxxxxxxxxxxxxx.)
04-19-2013, 10:16 AM
Find


Messages In This Thread
RE: Make an item appear after smashing plates? - by xxxxxxxxxxxxxxxx - 04-19-2013, 10:16 AM



Users browsing this thread: 1 Guest(s)