Victory Road Archive

You are viewing an archive of Victory Road.

Victory Road closed on January 8, 2018. Thank you for making us a part of your lives since 2006! Please read this thread for details if you missed it.

Technology → Oran Berry Script

Page 1 of 1

1. Anthony the Lucario said on May 10, 2009, 10:33:07 AM (-07:00)

Charizard
134 posts

Made with Lua for Roblox. It will heal a player that touches it.

Quote:
pokemon = "Buizel" --name for one, nil for all


function getPokemon()
if pokemon ~= nil and hit.Parent:findFirstChild(pokemon) ~= nil then
a = true end
elseif pokemon == nil then
a = true end
elseif pokemon ~= nil and hit.Parent:findFirstChild(pokemon) == nil then
a = false end
end
end

function onTouched(hit)
getPokemon()
if a = true then --If player has the "Buizel" Value or if there is no specific pokemon, then something happens
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.MaxHealth --Fully Healed
elseif a = false then -- If not, then something else happens
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health + 25
end
end

script.Parent:touched()(function onTouched()):Connect
Its actually broken, but wont take long to fix.
its also more difficult than it needs to be.

2. §ethi Xzon said on May 11, 2009, 05:34:08 PM (-07:00)

Floatzel
150 posts

Visual Basic 2008 Version

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ProgressBar1.Value = +20
        if ProgressBar1.Value = >=80 then
           ProgressBar1.Value = 100
         End Sub
I probably made a mistake as I was being rushed.

3. Cat333Pokémon said on May 23, 2009, 08:43:05 PM (-07:00)

Administrator
10,307 posts

That code is pretty close to correct if ProgressBar1 is your health bar and Button1 indicates eating an Oran Berry. A better version would be this:

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     If ProgressBar1.Value >= 80 Then
          ProgressBar1.Value = 100
     Else
          ProgressBar1.Value += 20
     End If
End Sub

4. §ethi Xzon said on May 23, 2009, 09:13:40 PM (-07:00)

Floatzel
150 posts

Yes it is. And that is a much better version.

Page 1 of 1

User List - Contact - Privacy Statement - Lycanroc.Net