Meca-Tech Official Forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Latest topics

» Nothing Really
Noob resistant Hover brick script EmptyThu Apr 08, 2010 3:18 pm by Wako98

» X-101 Enemies
Noob resistant Hover brick script EmptyThu Dec 31, 2009 1:48 pm by TrickyMaster11

» Hello! I'm new.
Noob resistant Hover brick script EmptyThu Dec 31, 2009 1:39 pm by TrickyMaster11

» Groups: WHAT THEY ARE
Noob resistant Hover brick script EmptySun Dec 13, 2009 1:06 pm by Xtreme101

» Hi I am New.
Noob resistant Hover brick script EmptyThu Nov 05, 2009 9:20 pm by Robo6420

» Notice: Please Use your ROBLOX account.
Noob resistant Hover brick script EmptyThu Nov 05, 2009 9:19 pm by Robo6420

» Noob resistant Hover brick script
Noob resistant Hover brick script EmptyThu Oct 08, 2009 6:29 pm by Robo6420

» Invitation Poll
Noob resistant Hover brick script EmptyThu Oct 08, 2009 4:47 pm by Robo6420

» My First Video
Noob resistant Hover brick script EmptyThu Oct 08, 2009 4:42 pm by Robo6420


3 posters

    Noob resistant Hover brick script

    V1buzzbomb
    V1buzzbomb
    Member
    Member


    Posts : 8
    Join date : 2009-09-30

    Noob resistant Hover brick script Empty Noob resistant Hover brick script

    Post  V1buzzbomb Wed Oct 07, 2009 8:39 pm

    This is a hover brick script I made for general use. Hopefully It will be used in the hover-tanks project. The script can make just about any hover-brick just by changing a few values. The script also dos dome basic checks in case the user uses it wrong. To use simply paste into a brick and set the options to what you want.


    Code:


    --~~~~~~~~~~~~~~~~~~~~User settable variables~~~~~~~~~~~~~~~~~~~~--

    local FORCE = 10000 -- the amount of force this brick will apply to
    local SPEC_POS = false -- set to true to specify a specific high for the brick to float at. Otherwise it floats at it's current hight.
    local HIGHT = 0 -- How high the brick should float if SPEC_POS it true
    local TOGGLE = false -- If true the brick will be a click enabled hover brick
    local CLICK_DISTANCE = 32 -- How far away the hover brick can be turned on/off if TOGGLE is true
    local DEFUALT_SET = false --determines what state the brick starts out in if TOGGLE is true. false = off and true = on

    --~~~~~~~~~~~~~~~~~~~Do not touch below this line~~~~~~~~~~~~~~~~~~~--

    this = script.Parent
    local toggle = false

    function clicked()
       if toggle == true then
          bodyp.maxForce = Vector3.new(0,0,0)
          this.Transparency = 0.50
          toggle = false
       else
          bodyp.maxForce = Vector3.new(0,FORCE,0)
          this.Transparency = 0
          toggle = true
       end

    end



    function exe()
          bodyp = Instance.new("BodyPosition")

          bodyp.maxForce = Vector3.new(0,FORCE,0)
          -------------------------------------------
          if SPEC_POS == true then -- handle specpos setting
             bodyp.position = Vector3.new(0,HIGHT,0)
             bodyp.Parent = this
          else
             bodyp.position = this.Position
             bodyp.Parent = this
          end
          --------------------------------------------
          if TOGGLE == true then --handle toggle settings
             cd = Instance.new("ClickDetector")
             cd.Parent = this
             cd.MaxActivationDistance = CLICK_DISTANCE
             cd.MouseClick:connect(clicked)
                
             if DEFUALT_SET == true then
                   clicked()
             else
                clicked()
                clicked()
             end
          end
          ---------------------------------------------
       
          
    end



    if this.className == "Part" then --If the script is not a child of a Part then warn the user of the problem
       if this.Anchored == true then --If the brick is anchored then warn the user
          print("Warning: This brick is anchored, the brick will still Hover if you unanchore it but my send objects flying while it's anchored")
       end
       exe()
    else
       print("Error: This script's parent is not a valid \"Part\" object. Please insert into a object with the className of \"Part\" (aka a brick).")
    end

    --~~~~~~~~~~~~~~~~~~~~Created by V1buzzbomb~~~~~~~~~~~~~~~~~~~~--

    MegaZete
    MegaZete
    Basic Forumer
    Basic Forumer


    Posts : 155
    Join date : 2009-09-29
    Age : 29
    Location : Somewhere someplace

    Noob resistant Hover brick script Empty Re: Noob resistant Hover brick script

    Post  MegaZete Wed Oct 07, 2009 9:41 pm

    Noob Resistant?
    V1buzzbomb
    V1buzzbomb
    Member
    Member


    Posts : 8
    Join date : 2009-09-30

    Noob resistant Hover brick script Empty Re: Noob resistant Hover brick script

    Post  V1buzzbomb Wed Oct 07, 2009 9:45 pm

    It warns the user of possible noob mistakes that would make the script malfunction. Like inserting it in the wrong place or anchoring the hover brick. The script then tells theme then correct the problem.
    avatar
    Robo6420
    Member
    Member


    Posts : 40
    Join date : 2009-10-06

    Noob resistant Hover brick script Empty Re: Noob resistant Hover brick script

    Post  Robo6420 Thu Oct 08, 2009 4:39 pm

    Noob what?!? Noob resistant Hover brick script Icon_question
    (im not a noob)
    V1buzzbomb
    V1buzzbomb
    Member
    Member


    Posts : 8
    Join date : 2009-09-30

    Noob resistant Hover brick script Empty Re: Noob resistant Hover brick script

    Post  V1buzzbomb Thu Oct 08, 2009 5:21 pm

    I wasn't calling you a noob, I was simply stating that it was noob resistant.
    avatar
    Robo6420
    Member
    Member


    Posts : 40
    Join date : 2009-10-06

    Noob resistant Hover brick script Empty Re: Noob resistant Hover brick script

    Post  Robo6420 Thu Oct 08, 2009 6:29 pm

    ino

    Sponsored content


    Noob resistant Hover brick script Empty Re: Noob resistant Hover brick script

    Post  Sponsored content

      Similar topics

      -

      Current date/time is Fri Apr 26, 2024 9:34 am