Thursday, May 2, 2013

ROBLOX Scripting: Explaining Values

When being a scripter, having values are essential, I could use a few Values to make a simple inventory system, or to tell whether a plowing field is being used, using a Boolean Value. If you are to be a successful ROBLOX scripter, on your journey you must learn a Value, so I'm gonna teach you.

On the current game I'm making, Forgotten Fate, I have used a various amount of Values with a varied choice of which Value, I used the Boolean Value on a crop field, and a String Value for finding the crop that you want to plant. Somehow with a Value everything can be simpler, most of the Values I uses are implemented on the if statement, for example:

if script.Parent.NoobValue.Value==true then
script.Parent.Parent.Parent.Character.Humanoid.Health=0
wait()
end

That meant if the person is a noob, then they will be killed, that is just one of the simple things you can have done with a value.

You could have an inventory model, which had lots of boolean values, each named after a sword, and if the sword = true then the sword would clone to the players Backpack. Boolean Values and Number Values are probably the most useful in my point of view, Boolean Values are my best friends, well, Lolfunny12345 is my best friend. A boolean value can also take place in a script, like debounce.

local noobboolean = false

That would be how you denounce a boolean value in a script. To have a better understanding of Values, you would have to use them, because I had no idea what ipairs was until I used it. It's all in your brain, it depends on the best way you learn, which makes something easier, I'm writing for people who can learn from articles and reading. But you could probably learn from more ways, perhaps YouTube would have a tutorial somewhere along the line.

Visit Roblox Wiki

Thanks for reading.
Zakary99

3 comments:

  1. so
    if Backpack.ChildAdded.Sword==True
    then
    Workspace.Enemy.HumaniodHealth=0
    grabbing sword will kill an enemy?

    ReplyDelete
  2. You could just do,
    if Backpack:findFirstChild("Sword") then
    Workspace.Enemy:BreakJoints()

    ReplyDelete

Write your comment here... OR Flingi will eat you