Make a SIMPLE Conveyor Belt | Roblox Scripting Tutorial

Поділитися
Вставка
  • Опубліковано 8 січ 2025

КОМЕНТАРІ • 38

  • @MacAndSwiss
    @MacAndSwiss  4 роки тому

    Here are the finished scripts!
    Disclaimer: Please try to follow along in the video and create the scripts yourself before resorting to copy+pasting. The only person that you're cheating is yourself.
    --Conveyor Belt
    script.Parent.Velocity = script.Parent.CFrame.LookVector * 5
    --
    --Click Detector
    local ClickDetector = script.Parent.ClickDetector
    ClickDetector.MouseClick:Connect(function(player)
    local Item = player.Backpack:FindFirstChild("Tool")
    Item.Parent = script.Parent
    Item:FindFirstChild("Handle").CFrame = script.Parent.CFrame + Vector3.new(0,3,0)

    --Make sure that everything is held together
    for _, part in ipairs(Item:GetDescendants()) do
    if(part:IsA("BasePart") or part:IsA("MeshPart")) then
    part.CanCollide = true
    end
    end
    --

    end)
    --
    --Weld/Tool
    for _, part in pairs(script.Parent:GetDescendants()) do
    if(part:IsA("BasePart") or part:IsA("MeshPart")) then
    local NewWeld = Instance.new("WeldConstraint")
    NewWeld.Part0 = part
    NewWeld.Part1 = script.Parent:FindFirstChild("Handle")
    NewWeld.Parent = part
    end
    end
    script.Parent.Equipped:Connect(function()
    for _, part in ipairs(script.Parent:GetDescendants()) do
    if(part:IsA("BasePart") or part:IsA("MeshPart")) then
    part.CanCollide = false
    end
    end
    end)
    --

  • @profloth270
    @profloth270 2 роки тому +3

    MacAndSwiss please do a new tutorial bc the surface option isn't available now so please help me

  • @blueas958
    @blueas958 3 роки тому

    Wow!!!!!!!! This is useful for my upcoming story game! Thank you!

  • @profloth270
    @profloth270 3 роки тому +1

    I can't find the 'surface' in properties

  • @Omosha61
    @Omosha61 4 роки тому

    Wow! I am Korean. I learned well after watching your video. Thank you for uploading the video.

  • @OrionHartwick
    @OrionHartwick 4 роки тому

    Thanks so much, Subscribed and liked

  • @kevgaming222
    @kevgaming222 2 роки тому

    I have a problem, when i press the button, my luggage wont come out.

  •  4 роки тому

    amazing video!

  • @wythernz765
    @wythernz765 4 роки тому +2

    I can’t see surfaces in properties ;-;

    • @MacAndSwiss
      @MacAndSwiss  4 роки тому +2

      Yeah, they removed it. One way you can kinda figure it out is to use a surfaceUI on the front

    • @wythernz765
      @wythernz765 4 роки тому

      MacAndSwiss thanks. I used that earlier after noticing but thanks for the suggestion!

    • @cyan5454
      @cyan5454 4 роки тому +1

      @@wythernz765 Hey how to use it same problem pls reply

    • @profloth270
      @profloth270 3 роки тому

      @@MacAndSwiss how i don't understand can you do a video ?

  • @SwissAviator
    @SwissAviator Рік тому

    i think roblox updated roblox studio because you can no longer change the surface to a motor for some reason, could you make a new video or tell me how i can add a motor with updated version

    • @Pineyyyyy
      @Pineyyyyy 7 місяців тому

      anchor the part and insert this into the script.
      local ConveyerSpeed = 14 -- Change this to how ever fast you want your conveyer to move
      while true do
      script.Parent.Velocity = script.Parent.CFrame.lookVector *ConveyerSpeed
      wait(0.1)
      end

    • @SwissAviator
      @SwissAviator 7 місяців тому

      @@Pineyyyyy tysm

  • @Gxdurf
    @Gxdurf 2 роки тому

    Now i have made this now i need a baggage claim

  • @frenchfries4294
    @frenchfries4294 4 роки тому +1

    Hi can u do a plane storage tutorial like u put it in ur plane and then click it to place the suitcase and also be able to pick it up again when clicked

    • @aviamud
      @aviamud 3 роки тому

      Hi there. I just saw this. I'm gonna make that a model, and i'll reply to this comment with it.

  • @profloth270
    @profloth270 3 роки тому

    how to make the baggage item

  • @haxelux31
    @haxelux31 3 роки тому

    But how to send this baggage to another airport in same game

  • @Cedricx
    @Cedricx 4 роки тому

    Can you script things on my tech company?

    • @MacAndSwiss
      @MacAndSwiss  4 роки тому

      Unfortunately, I'm busy with school and other things right now so I'm not taking on any additional jobs.

  • @PinguPlays
    @PinguPlays 4 роки тому +1

    can u put script in comments

  • @louiseking1756
    @louiseking1756 3 роки тому

    I have a error which says ‘attempt to index nil with parent’ on line 5 can anyone help?

    • @MacAndSwiss
      @MacAndSwiss  3 роки тому

      A couple of things that might be the issue:
      - "index nil with parent" means that you're trying to get the parent of nil, or something that doesn't exist. You might wanna double-check the object or whatever you're trying to get, and make sure things are spelled correctly.
      - Getting the parent of something is Parent with a capital P (just in case)

    • @louiseking1756
      @louiseking1756 3 роки тому

      I’ve checked the spelling of ‘Suitcase’ and it’s the exact same.
      I have added all my Parents with a capital P.
      Still doesn’t work :/
      Edit: It’s now worked but I’m not able to say SuitCase now it has to be called tool.
      Is there a way that when clicked on Click part the suitcase is on its back instead of up straight?

  • @jaydensantiago9035
    @jaydensantiago9035 4 роки тому

    it didnt work for me it was moving everything on the floor. and it was moving the wrong way.

    • @MacAndSwiss
      @MacAndSwiss  4 роки тому

      Make sure that the part (and stuff touching it) are either anchored or welded to an anchored part. As for the moving the wrong way part, make sure that the conveyor is facing the right way (check to see which side is the "front").

    • @Devingx
      @Devingx 4 роки тому

      @@MacAndSwiss I can't seem to find a plug-in that let's you see the front or back

    • @Buddy_Playz
      @Buddy_Playz 4 роки тому

      @@Devingx Go to properties, scroll all the way down and go to Surface.

  • @PinguPlays
    @PinguPlays 4 роки тому

    Ok. thx for answer me with this vid

  • @SkyfromJapan
    @SkyfromJapan 4 роки тому

    Give me script

  • @yellow_bloxplayz8720
    @yellow_bloxplayz8720 4 роки тому

    me thinking you had a few hunderd k subs

    • @MacAndSwiss
      @MacAndSwiss  4 роки тому

      Hit that subscribe button and maybe that can be real one day 😉

  • @mu33ins74
    @mu33ins74 4 роки тому

    I DM you on discord please look thanks :)

  • @sunsarbrilem
    @sunsarbrilem Рік тому

    Learn piano