Latest topics

» Nothing Really
Thu Apr 08, 2010 3:18 pm by Wako98

» X-101 Enemies
Thu Dec 31, 2009 1:48 pm by TrickyMaster11

» Hello! I'm new.
Thu Dec 31, 2009 1:39 pm by TrickyMaster11

» Groups: WHAT THEY ARE
Sun Dec 13, 2009 1:06 pm by Xtreme101

» Hi I am New.
Thu Nov 05, 2009 9:20 pm by Robo6420

» Notice: Please Use your ROBLOX account.
Thu Nov 05, 2009 9:19 pm by Robo6420

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

» Invitation Poll
Thu Oct 08, 2009 4:47 pm by Robo6420

» My First Video
Thu Oct 08, 2009 4:42 pm by Robo6420


    Noob resistant Hover brick script

    Share
    avatar
    V1buzzbomb
    Member
    Member

    Posts : 8
    Join date : 2009-09-30

    Noob resistant Hover brick script

    Post  V1buzzbomb on 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~~~~~~~~~~~~~~~~~~~~--

    avatar
    MegaZete
    Basic Forumer
    Basic Forumer

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

    Re: Noob resistant Hover brick script

    Post  MegaZete on Wed Oct 07, 2009 9:41 pm

    Noob Resistant?


    _________________
    MegaZete is taking over by storm!
    avatar
    V1buzzbomb
    Member
    Member

    Posts : 8
    Join date : 2009-09-30

    Re: Noob resistant Hover brick script

    Post  V1buzzbomb on 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.

    Robo6420
    Member
    Member

    Posts : 40
    Join date : 2009-10-06

    Re: Noob resistant Hover brick script

    Post  Robo6420 on Thu Oct 08, 2009 4:39 pm

    Noob what?!?
    (im not a noob)
    avatar
    V1buzzbomb
    Member
    Member

    Posts : 8
    Join date : 2009-09-30

    Re: Noob resistant Hover brick script

    Post  V1buzzbomb on Thu Oct 08, 2009 5:21 pm

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

    Robo6420
    Member
    Member

    Posts : 40
    Join date : 2009-10-06

    Re: Noob resistant Hover brick script

    Post  Robo6420 on Thu Oct 08, 2009 6:29 pm

    ino

    Sponsored content

    Re: Noob resistant Hover brick script

    Post  Sponsored content


      Current date/time is Fri Jul 20, 2018 5:55 am