Make arrow point to part | Roblox Scripting Tutorial

Поділитися
Вставка
  • Опубліковано 24 лют 2021
  • Hope this video helped you!
    ArrowModel: www.roblox.com/library/644262...
    LocalScript: pastebin.com/xDpeGE30

КОМЕНТАРІ • 76

  • @redmoose5553
    @redmoose5553 28 днів тому

    Thanks man, you explained it rlly well and the logic of it isn't even confusing. Thanks a lot. :)

  • @trda
    @trda Рік тому +2

    EXACTLY WHAT I NEEDED! THANK YOU!

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

    Thanks Kid! You are truly GigaChad

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

    Thanks you just got a sub

  • @charonum308
    @charonum308 3 роки тому +3

    THIS IS WHAT I NEEDED

  • @SpazatronVFX
    @SpazatronVFX 2 роки тому +1

    bro thank you so much!

  • @celiabrockman9726
    @celiabrockman9726 2 роки тому +1

    I love it this is the best one ever

  • @EliottOriginalFR
    @EliottOriginalFR 8 місяців тому +1

    Helped me much, just make a better thumbnail, go full screen, speak louder, edit a bit, and your videos will be insane!

  • @Sweet_Plays
    @Sweet_Plays Місяць тому

    THANK YOU

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

    Great!

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

    do u know a possibility to make the arrow only point the part in the X axis

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

    Can you make when you hold a gear and the arrow will shown up.

  • @Assyrianmaps
    @Assyrianmaps 8 місяців тому +1

    tyy

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

    how do i make it so that it only works once for new plays and never show up again

  • @BroChill99
    @BroChill99 8 місяців тому

    how to make own arrow model? i want to make it by myself

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

    Nice video but how to make this happen only if you equip a tool?

  • @KingIntroAndMoreSubRoblox
    @KingIntroAndMoreSubRoblox Рік тому +5

    local ArrowModel = game.ReplicatedStorage:WaitForChild("ArrowModel"):Clone()
    local player = game.Players.LocalPlayer
    local char = player.Character or player.CharacterAdded:Wait()
    local arrowgoto = workspace.Part -- Make "Part" into your part name
    ArrowModel.Parent = workspace
    ArrowModel.Name = player.Name.."'s Arrow"
    game:GetService("RunService").RenderStepped:Connect(function()
    ArrowModel.PrimaryPart.CFrame = CFrame.new(char.HumanoidRootPart.Position, arrowgoto.Position)
    end)
    arrowgoto.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    ArrowModel:Destroy()
    script.Disabled = true
    end
    end)
    script to remove arrow when touched part

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

      It's a bug because there are too many part named objects. The code doesn't work when I direct it to the ArrowPart object.

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

      im sorry if i sound stupid but can i ask where do i put that script into?

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

      Ty!

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

      @@zekoyt StarterCharacterScripts

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

      BROO TYSM!!!!!!

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

    Guys let me know what I should make a video on next! I really need video ideas to keep going.

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

      make an npc follow the player.

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

      ok so i like the arrow thing but i think you should make a more advanced one where its is a trail of arrows leading to the block. also make it so you could fit it inside a tutorial, so if you press a button (a gui button) it will show you where it is, and also when you press another button it will disappear.

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

      @@proatplanes That is actually quite easy to achive by using beams, i could probably make a tutorial on it.

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

      @@xSweDev that would be great, im struggling on making a tutorial and the arrow will help.

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

      or beam, i cant find it on youtube so i asked you.

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

    tysmmmm

  • @rawr5700
    @rawr5700 2 роки тому +5

    can you make it where when you touch the part it navigates to another part?

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

    thanks

  • @BroChill99
    @BroChill99 5 місяців тому

    It didn't work. Is it because when
    ArrowModel.PrimaryPart.CFrame = CFrame.new(char.HumanoidRootPart.Position, workspace.ArrowModel)
    The workspace.ArrowModel? Maybe is it supposed to be ReplicatedStorage.ArrowModel?

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

    can u make it so it makes a new arrow and points to new prompt plz and ty

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

    UPDATE: This feature is deprecated which means that you have to do "CFrame.LookAt" instead of doing "CFrame.new"!

  • @leavesfed5462
    @leavesfed5462 Рік тому +1

    I copied the exact code. However, I am left with this error: 20:04:09.563 Players.leavesfed.PlayerScripts.LocalScript:9: attempt to index nil with 'CFrame' - Client - LocalScript:9
    I named all the parts exactly like you did

    • @rllydaniel
      @rllydaniel 5 місяців тому

      have you resolved this issue or given up?

    • @ytpotr
      @ytpotr 5 місяців тому

      same@@rllydaniel

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

    For hire

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

    entered all the script, but my arrow just sits where i left it when i started scripting

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

      nevermind, but now i just can see the arrow in game

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

    Can u pls make a video about a script showing how to make it so it disappears when u touch it

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

      local ArrowModel = game.ReplicatedStorage:WaitForChild("ArrowModel"):Clone()
      local player = game.Players.LocalPlayer
      local char = player.Character or player.CharacterAdded:Wait()
      local arrowgoto = workspace.Part -- Make "Part" into your part name
      ArrowModel.Parent = workspace
      ArrowModel.Name = player.Name.."'s Arrow"
      game:GetService("RunService").RenderStepped:Connect(function()
      ArrowModel.PrimaryPart.CFrame = CFrame.new(char.HumanoidRootPart.Position, arrowgoto.Position)
      end)
      arrowgoto.Touched:Connect(function(hit)
      if hit.Parent:FindFirstChild("Humanoid") then
      ArrowModel:Destroy()
      script.Disabled = true
      end
      end)
      -- isn't mine. -ImKing

  • @forestanonymous
    @forestanonymous 2 роки тому +1

    hey, i scripted it like that when i walk to the part, it is being destroyed. How do i make it so when the part is destroyed, the arrow is destroyed too?

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

      ArrowModel:Destroy() set a magnitude check between the player and the part ur pointing at.

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

    at the end of the script i tried adding
    workspace.Portal1.PortalPart.Touched:Connect(function(hit)
    if hit.Parent == player then
    ArrowModel:Destroy()
    end
    end)
    to get the arrow destroyed when PortalPart is touched but it doesnt work. Does anyone know why?

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

      workspace.Portal1.PortalPart.Touched:Connect(function(hit)
      if hit.Parent.Name == player.Name then
      ArrowModel:Destroy()
      end
      end)

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

    mine never works in anything

  • @BussinesMan-qe4st
    @BussinesMan-qe4st Рік тому

    nice one but how can i make it multiplie arrows? please respond

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

      You could make the code into a function that whenever you call the function, it creates a new arrow pointing to a position.

  • @CaTTon.
    @CaTTon. 3 роки тому

    please do it when one touches a block the arrow appears

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

      @LuaCoded Exactly

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

    notice how he never touches the block i tried it and when i touched the block the arrow didnt go away

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

      It was never said in the video that this would be a feature, if you want this feature then you are going to have to make it yourself. You can detect collisions with Part.Touched to see if the player touches the part and then destroy the arrow.

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

      @@xSweDev alr

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

    Please obby arrow system. Would you. :-)

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

    it doesn't work

  • @jackchihuahua
    @jackchihuahua 2 роки тому +1

    Are you American or a different country?

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

      I am from Sweden

  • @LemonDeveloper
    @LemonDeveloper 2 роки тому +5

    Can u make it when you touch the part it disappears

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

      Just do a .Touched event to detect a touch then destroy/ set the transparency of the part.
      developer.roblox.com/en-us/api-reference/event/BasePart/Touched

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

      @@xSweDev I’m a new developer and I just don’t know how to involve the part to be destroyed once touched is there a way you could put the script for that in here.

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

      @@xSweDev I don’t understand

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

      @@think_its_ty7510 Just use script.Parent:Destroy() - Put that as a script into your part and it'll destroy it.

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

      @@rblxcasino5104 I dont think that works anymore

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

    i made it so when u touch the part the arrow is gone but how do i make the game remember that i touched the part when i rejoin it again show me the arrow:
    local ArrowModel = game.ReplicatedStorage:WaitForChild("ArrowModel"):Clone()
    local player = game.Players.LocalPlayer
    local char = player.Character or player.CharacterAdded:Wait()
    ArrowModel.Parent = workspace
    ArrowModel.Name = player.Name.."'s Arrow"
    game:GetService("RunService").RenderStepped:Connect(function()
    ArrowModel.PrimaryPart.CFrame = CFrame.new(char.HumanoidRootPart.Position, workspace.ArrowPart.Position)
    workspace.ArrowPart.Touched:Connect(function(hit)
    if hit.Parent.Name == player.Name then
    ArrowModel:Destroy()
    end
    end)
    end)

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

      If you want the state of the arrow to save, you'll have to save some data using DataStore service. There are some great tutorials on storing data with DataStore service, so I recommend you check that out.

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

    do u know how to make it so it saves?