Victory Road  

Go Back   Victory Road > General > Technology

Notices

 
 
Search this Thread
  #1  
Old May 10, 2009, 09:33:07 AM
Anthony the Lucario Anthony the Lucario is offline
Charizard
 
Join Date: Apr 2009
Location: (Hiding from the X-101st)
Posts: 134
Default Oran Berry Script

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  
Old May 11, 2009, 04:34:08 PM
§ethi Xzon §ethi Xzon is offline
Floatzel
 
Join Date: Nov 2008
Posts: 150
Default Re: Oran Berry Script

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  
Old May 23, 2009, 07:43:05 PM
Cat333Pokémon's Avatar
Cat333Pokémon Cat333Pokémon is offline
Administrator

 
Join Date: Nov 2006
Location: Nevada
Posts: 10,303
Default Re: Oran Berry Script

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  
Old May 23, 2009, 08:13:40 PM
§ethi Xzon §ethi Xzon is offline
Floatzel
 
Join Date: Nov 2008
Posts: 150
Default Re: Oran Berry Script

Yes it is. And that is a much better version.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -8.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Victory Road ©2006 - 2024, Scott Cat333Pokémon Cheney
Theme by A'bom and Cat333Pokémon