Roblox Touch Events: Ultimate Guide

Поделиться
HTML-код
  • Опубликовано: 28 янв 2025

Комментарии •

  • @CyberCreator
    @CyberCreator  4 года назад +20

    If you have any questions or requests for future videos, let me know!

    • @darrenchong2054
      @darrenchong2054 4 года назад +6

      Yes I do could u make a video that makes a brick with health gets damaged when the npc enemy touches it.

    • @CyberCreator
      @CyberCreator  4 года назад +4

      @@darrenchong2054 That's really specific for a full video, but if you join my Discord I can help you work out how to do this. discord.gg/YWqUMzw

    • @darrenchong2054
      @darrenchong2054 4 года назад

      @@CyberCreator can u help me with a game problem I have?

    • @deputy_Nico
      @deputy_Nico 4 года назад

      How would I script it where when a vehicle touches an invisible box it can trigger the lights that I scripted to begin on my Drag Tree.

    • @TGJPyt
      @TGJPyt 3 года назад +1

      Question: How could I make it so if a player touches the part, it gives them a sword, and when they step off the part, it removes the sword from their inventory. Thanks!

  • @gr33gyss8
    @gr33gyss8 3 года назад +17

    Every step beautifully explained. Even when you explain something really well, you then explain it even further so that the audience completely understands. Outstanding. Thank you.

  • @kirtil5177
    @kirtil5177 3 года назад +22

    Thank you so much for explaining the syntax, that is by far the biggest reason i dont know how to make something work

  • @waterymonkey
    @waterymonkey 3 года назад +13

    AY THIS IS THE BEST TUTORIAL SEEN SO MANY THIS IS THE FIRST THAT EXPLAINS WHAT EVERYTHING THING DOES AND HOW TO BUILD IT TYSM

    • @CyberCreator
      @CyberCreator  3 года назад

      Glad I could help! Thanks for watching!

  • @JEDIMASTERTOAD
    @JEDIMASTERTOAD Год назад +2

    EXCELLENT TUTORIAL... I see so many young people rushing through tutorials and making errors mid video... this is perfect. If you're not a teacher , you should be because you're a natural. Very clear and well explained, also.

    • @JEDIMASTERTOAD
      @JEDIMASTERTOAD Год назад +1

      @TheDogCaused911 the best advice i could give you without seeing your script would be to check the syntax. Code is case sensative and must be precise. After that use prints to test points of your code instead of actions if you have acrid that are not triggering.
      Part.Touched:connect(function()
      print ("Part Touched")
      end)

  • @NewWaveEnthusiast
    @NewWaveEnthusiast 3 года назад +9

    Thanks for this video,the wiki didn't really explain it like it did for Functions.
    And holy shit,visual representations too? Lifesaver. Thanks so much for explaining the lines of code,and not just telling me "this will do that",I want to know what it does and how it works. Thanks again,you deserve my sub and like :D

    • @CyberCreator
      @CyberCreator  3 года назад +3

      I'm glad the video helped you out, and I appreciate the sub, like, and comment!

  • @TECHboi99Official
    @TECHboi99Official 3 года назад +3

    OMG THANK YOU SO MUCH!!! Im a new dev and i was making a game, but had trouble when the death counter went up by multiple numbers when we touched the brick...i added the debounce and now it works...Thanks a lot!! U earned a sub, like and multiple shares

    • @CyberCreator
      @CyberCreator  3 года назад

      Sweet! Good job getting it to work!

  • @Diamondhero380
    @Diamondhero380 Год назад

    TYSM, NO VIDEO HAS BEEN ABLE TO EXPLAIN IT AS GOOD AS YOU!!! YESSSSS!!!!

  • @User-i5t2h
    @User-i5t2h 2 года назад +3

    This video was super helpful to understand how this works! Thanks a lot! ✨

  • @nathanolivera6651
    @nathanolivera6651 4 года назад +2

    I watched you last month when you had 100 subs and now you have 2k subs congratulations

  • @pencilonpaper1026
    @pencilonpaper1026 Месяц назад

    awesome tutorial. actually explains everything needed so people wont go back to endless tutorial hell :)

  • @HFossyPlayz
    @HFossyPlayz 5 месяцев назад +1

    Thanks alot. This will help alot for me making a railway game for making the signals

  • @brodter4756
    @brodter4756 3 года назад

    Such clear concise and informative videos. Please keep doing these. I can't wait to learn from the rest of these.

  • @Reckless_Build
    @Reckless_Build 3 года назад

    Finally someone that can explain something CORRECTLY. EZ SUBCRIBE

  • @PresquileTO
    @PresquileTO 4 года назад +1

    this is helping me, how you're explaining what everything does. thank you :thumbs_up: this was on my b-day too

    • @CyberCreator
      @CyberCreator  4 года назад

      I'm glad I could help! Happy belated birthday, and don't forget to subscribe so you don't miss out on future videos!

  • @relaxingambience8855
    @relaxingambience8855 4 года назад +3

    Explained very well high quality content, I definitely subscribed because I want to say I was here before 100 subscribers, when you have 100,000.

    • @CyberCreator
      @CyberCreator  4 года назад +1

      Thanks! I'll see how quickly I can make you right!

  • @EnderGradRPC
    @EnderGradRPC 3 года назад

    one of the best tutorials I have seen

  • @bagelbananaalt5536
    @bagelbananaalt5536 3 года назад +1

    this is what I like about scripting, the possibility are endless and there are so many ways to mess around like when you touch a part, your head gets bigger or smaller

  • @nvermr
    @nvermr 3 года назад

    I didnt know about the built in disconnect function! now thats really cool

  • @Zrarlq
    @Zrarlq Год назад

    Thank you so much for this video, I have learn lots I hope that you can make more tutorials in the future!

  • @Sharkpop0
    @Sharkpop0 3 года назад +2

    this was made on my birthday no wonder why this is so cool B)

  • @huntertourvilleyt
    @huntertourvilleyt 3 года назад +2

    thanks man great tutorial!

  • @_an_bakan_5580
    @_an_bakan_5580 Год назад

    Thank you so much dude! I can now make a working monolith in my Solar System exploration game!

  • @mrgonuts
    @mrgonuts 11 месяцев назад

    thanks really clear and well put together

  • @Rafwellz
    @Rafwellz 3 года назад +2

    thank you!!!! this was very helpfull :)

  • @peterbakoss8803
    @peterbakoss8803 3 года назад +1

    Will you remember me when you become famous? :)

  • @chanchowaton
    @chanchowaton 3 года назад +1

    best tutorial so far

  • @innerboth7074
    @innerboth7074 3 года назад

    Thank you for explaining everything step by step 🙏

  • @kourr483
    @kourr483 Год назад

    bro thank you so much i finally understand because of u!!!

  • @kaniac_
    @kaniac_ 3 года назад

    Thanks so much dude helped alot

  • @JoonYorigami
    @JoonYorigami 3 года назад +2

    Thank you, yo! I made a small script without copying an entire script :D

  • @idkhahahaha
    @idkhahahaha 3 года назад +1

    you are a saint

  • @colintjuhh
    @colintjuhh 2 года назад

    This is so well understandable

  • @menoitius5587
    @menoitius5587 4 года назад +9

    Question: Why isn't this video popular? Also do you mind giving me a quick session to teach me a bit more on stuff.

    • @CyberCreator
      @CyberCreator  4 года назад +4

      I appreciate the feedback. Hopefully it does get more popular! Do you have any specific questions? I could make some videos to cover anything you don't understand so others can learn as well.

    • @maxb.4933
      @maxb.4933 3 года назад +1

      @@CyberCreator ive got a question, how do you make a script play when you are in a certain area? In my game there is a tunnel and i have a disco script that I want to play ONLY inside the tunnel

    • @Offdopp
      @Offdopp 3 года назад

      @@maxb.4933 Try using 'if' statements and positional tracking

  • @JimmyButBetter
    @JimmyButBetter 2 года назад

    Ive been trying figure out how to detect if otherpart is a humanoid, hopefully this video helps!

  • @slaplily
    @slaplily 3 года назад

    Helpful vid! But I want to make a game where when you stand on a brick a dialog from an npc starts and you can ask questions by clicking on buttons, how would you do that?

  • @xswords5086
    @xswords5086 2 года назад

    this is soo helpful thank you still good in 2022

  • @Valorantclips47
    @Valorantclips47 2 года назад +1

    What do i put instead of “humanoid” if I’m trying to do a specific part instead

  • @joephis
    @joephis 3 года назад +2

    sorry for another comment lol, but how do you find the player or character (whichever is easier) of a player that pressed a text button?

    • @CyberCreator
      @CyberCreator  3 года назад

      If you are using a LocalScript, you can just type game.Players.LocalPlayer. If you are using a Script, you would need to work your way up to the Player.
      So if the Structure is Player->PlayerGui->ScreenGui->TextButton->Script
      You could get the player with script.Parent.Parent.Parent.Parent because the Player is the 4th Parent of the script.

  • @lisadoesstuff9368
    @lisadoesstuff9368 3 года назад

    Hi Cyber I have a tutorial idea for you! You have a bow and there's a target and when you shoot at the target a block appears

  • @SpaceCwboi
    @SpaceCwboi 3 года назад +2

    Is there a way that I can walk over a part that destroys a different part once touched?

    • @biack1st
      @biack1st 3 года назад

      Yeah heres some code to use:
      local part = script.Parent -- the variable of that part u touch
      local destroyBrick = game.Workspace.destroyman -- change "Destroyman" to the parts name.
      local function remove(player)
      destroyBirck:Destroy()-- destroys the other brick
      end
      part.Touched:Connect(remove) -- making it do the block of code above when you touch the part.

    • @itzdynamic9356
      @itzdynamic9356 3 года назад

      @@biack1st hey do you know how to make it like a riddle on it for instance if you find part 1 part 2 is now visible and part 1 is destroyed by any chance?

  • @Flandersfieldscollector
    @Flandersfieldscollector 3 года назад

    Great video

  • @deputy_Nico
    @deputy_Nico 4 года назад +2

    How would I script it where when a vehicle touches an invisible box it can trigger the lights that I scripted to begin on my Drag Tree.

    • @CyberCreator
      @CyberCreator  4 года назад +1

      Join the discord and we can help discord.gg/vrHQCMM

  • @futurismepic8537
    @futurismepic8537 3 года назад +1

    touch event could be used in anywhere its insane

  • @Rshers
    @Rshers 2 года назад

    Im very laggy on roblox studio,
    Fast or not the F5(run) is always laggy so i need a good teacher, anyways thank you for making this video

  • @kirillstricke1387
    @kirillstricke1387 3 года назад +1

    please help how to make it so that if you touched the block then it will change the sky

  • @adilailma5658
    @adilailma5658 Год назад

    OMG THANK YOU SO MUCH

  • @kitteryt7252
    @kitteryt7252 3 года назад +3

    Yo!! Nice Vid, but may I get some help? I need it where if someone touches a brick it triggers a local script. ( I am trying to make it where if you touch a brick it triggers this local script which makes it if you press a key it will animate) Please help, if you can I need it ASAP for my game!

    • @CyberCreator
      @CyberCreator  3 года назад

      Join the discord and we can help you out! discord.gg/X3zdqHy

  • @pablobossfightcreator9654
    @pablobossfightcreator9654 2 года назад

    Thank you very much!

  • @catchphrasechristian952
    @catchphrasechristian952 2 года назад

    Thank you so much.

  • @mafiali2523
    @mafiali2523 4 года назад +1

    just wondering, is there a way where you can touch a part and a gui pops up to teleport somewhere

    • @CyberCreator
      @CyberCreator  4 года назад

      Yes! Use the code shown in the video to make to check if a player touched a part, and then if so make the Gui visible by toggling the "Enabled" property of the ScreenGui from false to true. You will want to use a debounce if you are copying the ScreenGui to the player's PlayerGui

  • @kleenexdrinker
    @kleenexdrinker 3 года назад +1

    i didn't watch the whole thing but, If this doesn't have a feature that can detect if your left arm or right arm touches a player after clicking e or r or something could you make a tutorial on it?

    • @CyberCreator
      @CyberCreator  3 года назад

      That sounds pretty specific. We can help you work up a solution if you join the discord discord.gg/X3zdqHy

  • @sparklyspartan1833
    @sparklyspartan1833 3 года назад +1

    Hello CyberCreator I have a question, if I wanted to change something about the part that was actually hit with a touched event, or do something only if that part has a specific property (like material), how could I access that part?
    Oh and also the reason I can’t just put a script in the part and use script.parent is that I’m using a loop to connect the event to multiple parts as opposed to putting scripts in every single part

    • @CyberCreator
      @CyberCreator  3 года назад +1

      This is a really good question. The solution is to wrap the function that you are connected to with another function. At the time of looping through and connecting a function to the part, you have access to the part. This means you can just provide the part itself as a parameter to the function. I have an example below. Please keep in mind that the model could be wherever in this case. Let me know if you have questions
      local model = script.Parent
      local function doSomething(brick)
      print(brick.Name .. " was hit")
      end
      for _, part in ipairs(model:GetChildren()) do
      if part:IsA("Part") then
      part.Touched:Connect(function()
      doSomething(part)
      end)
      end
      end

    • @sparklyspartan1833
      @sparklyspartan1833 3 года назад +1

      @@CyberCreator wow thanks, I think I get it, I need access to both the part and the other part, but I can just pass them both into the inner function right?

    • @CyberCreator
      @CyberCreator  3 года назад

      @@sparklyspartan1833 Yep that is correct

  • @15huynh
    @15huynh 4 года назад +1

    I wanted one of the part touch on an object and exploded can you do that?
    I would be appreciate about it. 😊

    • @CyberCreator
      @CyberCreator  4 года назад

      script.Parent.Touched:Connect(function(hit)
      local explosion = Instance.new("Explosion")
      explosion.Position = hit.Position
      explosion.Parent = hit
      end)
      Put this in a script in a part

  • @ns33333
    @ns33333 2 года назад

    Hello, I was trying to find out how to do this, but with changing the material instead of color.. I tried changing the words color here to material, but that did not work. Could you please make a tutorial?!

  • @leftovers-content
    @leftovers-content 4 года назад +1

    I have a question: if this script is wrong or correct:
    Local Mypart = game.workspace.part
    Function Test()
    Print ("Its Worked")
    end
    script.parent.Mypart.Touched:Connect(Test)
    I don't know if the reference here is wrong. can answer please?

    • @CyberCreator
      @CyberCreator  4 года назад

      That is correct for the most part. You should note that capitalization is important. I've corrected your code below. I corrected the capitilization and the last line. I also added the local keyword in front of Test(). While this wasn't necessary, it is recommended. I have a video on local if you want to check it out.
      local Mypart = game.workspace.Part
      local function Test()
      print ("Its Worked")
      end
      Mypart.Touched:Connect(Test)
      Mypart acts as shorthand for "game.workspace.Part
      " so you could alternatively type
      game.workspace.Part
      .Touched:Connect(Test)
      for the last line. This is because you are making Mypart store a reference to the part in workspace.

    • @leftovers-content
      @leftovers-content 4 года назад

      @@CyberCreator Thanks, helped alot!

  • @FutureProofDev
    @FutureProofDev 3 года назад +2

    local brick = script.Parent
    local function changeColor(otherPart)
    if otherPart.Parent:FindFirstChildWichIsA("Humanoid") then
    brick.BrickColor = BrickColor.Random()
    end
    end
    brick.Touched:Connect(changeColor)
    THat my code and this is my error
    FindFirstChildWichIsA is not a valid member of Workspace "Workspace"
    whats wrong

  • @yohimaster8359
    @yohimaster8359 3 года назад

    Hi i really want a collecting sytem if i step on a part its open a gui and every time i reach 10 coin = 1 rebirth it appear in the gui which can i collect can you show me how to do that its important for me :(

  • @regalmonkey7452
    @regalmonkey7452 4 года назад +1

    I am using a touch event to change the camera's position. However, when a player activates the touch event, the camera changes for all the players in game. I want it to change for the player that activates the touch event. Any help?

    • @CyberCreator
      @CyberCreator  4 года назад

      You could use a RemoteEvent and listen to the OnClientEvent method on the client. The server will use the FireClient function when a player has touched the part.
      Server code located within part:
      local Players = game:GetService("Players")
      local ReplicatedStorage = game:GetService("ReplicatedStorage")
      local camEvent = ReplicatedStorage:WaitForChild("CamChange")
      script.Parent.Touched:Connect(function(otherPart)
      if otherPart.Parent:FindFirstChildWhichIsA("Humanoid") then
      local player = Players:GetPlayerFromCharacter(otherPart.Parent)
      camEvent:FireClient(player)
      end
      end)
      Client code located in StarterPlayerScripts
      local ReplicatedStorage = game:GetService("ReplicatedStorage")
      local camEvent = ReplicatedStorage:WaitForChild("CamChange")
      local function changeCam()
      --Make whatever camera changes here
      workspace.CurrentCamera.FieldOfView = 100
      end
      camEvent.OnClientEvent:Connect(changeCam)
      As you can see, I placed the RemoteEvent named "CamChange within ReplicatedStorage. I hope this helped. Don't forget to like the video, subscribe for more, and join the Discord: discord.gg/Mtf4KNY

    • @regalmonkey7452
      @regalmonkey7452 4 года назад

      @@CyberCreator Oh alright! Thanks a ton!

    • @collinscoolness8072
      @collinscoolness8072 3 года назад

      I'm using this for when you touch a coin the coin disappeares only for the player that touched it can you plz try to do a thing where you make the script and tell me where to put the remote events, much appreciated

  • @ella-sb4ip
    @ella-sb4ip 3 года назад +1

    Hey sir how to make a jumpscare for horror game like When part touched an npc will appear and disappear for 3 seconds or more

    • @CyberCreator
      @CyberCreator  3 года назад

      Join the discord and I can help more. You could keep a copy of the NPC in ReplicatedStorage, clone the NPC when a player touches the part, set the NPC's CFrame to the player's CFrame / wherever you want it to appear, and then Parent the clone to workspace. You can then add the clone to the Debris service and it will automatically be deleted after whatever time you set

  • @vitezlucello
    @vitezlucello 4 года назад +1

    How do you make when you a tool and it has a part called touch and when you touch another part (not in tool) thats named puck it stick and when you left click the part (puck) shoots

    • @CyberCreator
      @CyberCreator  4 года назад

      You can check to see if the parts name is equal to puck. So if the variable "part" is what touched your tool, you would check if part.Name == "Puck" then do whatever you want to execute under that condition. My video on operators explains how the == works, and my video on conditional statements explains the if then statement. As far as the left click detection, you should use UserInputService and check for MouseButton1 input. developer.roblox.com/en-us/api-reference/class/UserInputService
      Be sure to join the Discord for more questions! discord.gg/vrHQCMM

    • @vitezlucello
      @vitezlucello 4 года назад

      @@CyberCreator Well I mean could you make if the puck (part) hits another part for example wall it plays a sound or gives a message to a gui

    • @CyberCreator
      @CyberCreator  4 года назад

      @@vitezlucello Sorry I didn't see this comment earlier. Yes you could check if the part has hit another part and then play a sound or make a gui pop up. Once the hit is detected, you could check if you've hit a part with the IsA function

  • @dukenuke5931
    @dukenuke5931 4 года назад +1

    I’m trying to create a function that tells me something touched the part and what the location of that part is in coordinates. how would I do that. I’m not sure how to access the players info.

    • @CyberCreator
      @CyberCreator  4 года назад +1

      Do you mean you're trying to get position of a player that touched the part?If so then you need to first check to see if it was a player that touched the part. If the parameter name you use for the part that touched the brick that is listening for the Touched event is called "partThatTouchedBrick", then you can check this with the conditional statement
      "if partThatTouchedBrick.Parent:FindFirstChild("Humanoid") then"
      If it was a player, then you can get the position of the player's root part
      "local characterPosition = partThatTouchedBrick.Parent.HumanoidRootPart.Position"
      Does that make sense?

    • @dukenuke5931
      @dukenuke5931 4 года назад

      @@CyberCreator yes that makes sense but what if it’s not a player but is like a missile or a plane. I’m trying to script a radarstation that detects whatever hits the radar wave and gives me it cords so I can then send that target info to a gun or missile.

  • @charleshurst7829
    @charleshurst7829 3 года назад +1

    excuse me CyberCreator, would you know how to make it so instead of the humanoid making everything react, how do i make it when an object (for instance, im making a soccer game and im looking for a touch event related to my goals and the soccer ball) touches another object and it reacts? im trying to make it so when my soccer ball touches the back of the net it reacts by saying goal. thankyou

    • @ProfessorSlimSlam1937
      @ProfessorSlimSlam1937 Год назад

      uhh i think you just replace humanoid with the name of your hit box i think

  • @fnonn
    @fnonn 3 года назад +1

    thank you

  • @joelacquah2204
    @joelacquah2204 2 года назад

    9:45 why isn't the first child bodycolors? (I just started to learned script a day ago)

  • @tihc1
    @tihc1 2 года назад

    Why do you use FindFirsrChildWhichIsA and not FindFirstChild? I did some research and the one you used is to find somethings class. Does that mean your explanation is incorrect?

  • @lightninggames6299
    @lightninggames6299 2 года назад

    for some reason the touched even is broken for me when ever i touch the part it just doesn't do anything and i tried putting a print and still nothing

  • @ananan9172
    @ananan9172 3 года назад +1

    Is there any way to make some trigger box without colliding

    • @CyberCreator
      @CyberCreator  3 года назад

      I'm not entirely sure what you mean? Maybe anchoring the part and turning CanCollide to false would work? Could you explain more?

  • @theduke4396
    @theduke4396 4 года назад +1

    can local scrips use touch events?
    if not how to i have it so when someone touches a part it gives them a sword

    • @murica_2330
      @murica_2330 4 года назад

      No you don't need to use local scripts to do that.
      local DB = true -- Cooldown
      Local part = game.Workspace.INSERTNAME -- replace INSERTNAME with your parts name
      part.Touched:Connect(function(hit) --"hit" Defines what touched it
      If hit.Parent:FindFirstChild("Humanoid") and DB == true then -- Will only look for things with humanoid in it (Usually players)
      DB = false
      local tool = Tool -- replace with where ever your tool is stored
      local Cloned = tool:Cloned()
      Cloned.Parent = hit.Parent -- Puts Tool inside player making them equip it
      Wait(5) -- Edit how long you want players to wait to get another Tool
      DB = true
      end
      end)
      I only wrote this with barely any time to check and see if it works, I hope this helps!

    • @CyberCreator
      @CyberCreator  4 года назад

      Yes, but it has to be in the correct location.
      A LocalScript will only run Lua code if it is a descendant of one of the following objects:
      A Player’s Backpack, such as a child of a Tool
      A Player’s character model
      A Player’s PlayerGui
      A Player’s PlayerScripts.
      The ReplicatedFirst service
      You can use a LocalScript, but the script has to be in one of those locations.
      I put this script in StarterPlayerScripts, and it works. It helps to understand when you need to use WaitForChild, and the Roblox Client-Server model, but it isn't completely necessary.
      local brick = workspace:WaitForChild("Part")
      brick.Touched:Connect(function(otherPart)
      print (otherPart.Name)
      end

  • @Gorrilarr
    @Gorrilarr Год назад

    thank you so much

  • @espero_dev
    @espero_dev 3 года назад +1

    How do I make it pop up a perches on screen but the perches is invisible

  • @yesno4248
    @yesno4248 4 года назад +1

    hi so i have a throwable part that detects when it hits a humanoid but sometimes it just hits the humanoid and roles back what alternative to touch events can i use?

    • @CyberCreator
      @CyberCreator  4 года назад +1

      That's a good question. The touched event does sometimes not fire when it should. There are a few ways to improve the detection. One method would be to use raycasting to follow the path of the projectile and check to see if a player is in that path. Another method would be to use a Region3 in the range of where the projectile is and check to see if a part of a player is in the region. You can read about that here -> developer.roblox.com/en-us/api-reference/function/WorldRoot/FindPartsInRegion3. You could also see if increasing the size of your hitbox would work. By this I mean that you could weld a larger part to your projectile with CanCollide set to false and Transparency set to 1 and make this larger part responsible for listening for touch events. Raycasting would probably be your most accurate solution. What type of projectile is it and how does the projectile move? Also, thanks for watching!

    • @yesno4248
      @yesno4248 4 года назад +1

      @@CyberCreator my projectile is a ball that bounces and is just using physics and how would i keep moving the region? im new to region3
      edit: nevermind making a different hitbox for checking touched events works thanks

    • @CyberCreator
      @CyberCreator  4 года назад +1

      I’m glad to hear that worked out!

  • @fayking
    @fayking 4 года назад +3

    0:31
    beacon boi : **I AM SPEEEEEDD**

  • @tsgp2747
    @tsgp2747 4 года назад +2

    how to make a part that when you touch it it makes an other part can collide false

    • @CyberCreator
      @CyberCreator  4 года назад

      local part1 = script.Parent -- or wherever part1 is
      local part2 = game.Workspace:WaitForChild("Part2")
      part1.Touched:Connect(function(otherPart)
      if otherPart.Parent:FindFirstChild("Humanoid") then
      part2.CanCollide = false
      end
      end)

    • @tsgp2747
      @tsgp2747 4 года назад +1

      @@CyberCreator oh my god tysm

  • @ye11owsnowman_34
    @ye11owsnowman_34 4 года назад +1

    How do i make an event happen when a tool touch a part for example: a battery touches a generator

    • @CyberCreator
      @CyberCreator  4 года назад +1

      You could do that in the same was as shown in the video. However, you would likely want to check to see if the part that was touched is named "Generator" or whatever you name your generator. This is assuming you are listening for the Touched event of the Battery part

    • @ye11owsnowman_34
      @ye11owsnowman_34 4 года назад

      @@CyberCreator Thanks, helped a lot!

  • @itzdynamic9356
    @itzdynamic9356 3 года назад

    Hey I'm trying to make like a riddles script but I want it to be that you have to go to the first location to activate then go to the second riddle and the third and so on do you know how to pls I need help...

  • @JimmyButBetter
    @JimmyButBetter 2 года назад

    Found a bug in a script that plays a sound on client every time you touch but it was spamming the sounds like 3 of them if i touched the part, Thanks!

  • @milchbanane9087
    @milchbanane9087 2 года назад

    Well I had an issue and didn't know how to fix it, so I copied the exact script you used and it still spits out the same error.
    It says "FindFirstChildWichIsA is not a valid member of Workspace "Workspace""
    And if I walk over it, it displays one of my body parts (the one that touched it) instead of Workspace.

    • @opjes1wjwj
      @opjes1wjwj Год назад

      dont know if you fixed it but make sure you put a ":" instead of a "."

  • @professional_roblox_scripter
    @professional_roblox_scripter 3 года назад

    Bro i want to keep firing the touch event even when the player isnt moving. How do you do it?

  • @HIHIHELLOHI11872
    @HIHIHELLOHI11872 2 года назад

    ok wait but is there a way to make it so when a player touches a player they both die?

  • @funnycreak6232
    @funnycreak6232 3 года назад

    how do i make it so that, when the player touches the part, the body part that has touched the part gets deleted? i want to make like a eradication weapon in my game.

  • @joelacquah2204
    @joelacquah2204 2 года назад

    also if you can just type humanoid why do we use findfirstchild and if we are using findfirstchild why do we need to confirm it is a humanoid that what it's supposed to do?

  • @ikplayer3
    @ikplayer3 3 года назад

    how do you detect if another part is touching the part

  • @landenstyka
    @landenstyka 3 года назад +1

    How do I make it so when you touch a part it becomes unanchored?

    • @thealtrobloxdude785
      @thealtrobloxdude785 10 месяцев назад

      Idk.. if Part.Touched:Connect(function() then
      Part.Anchored = False
      end
      I think that's how, if im wrong, then find out by urself (im bad at some scripts)

  • @arnegraphics3380
    @arnegraphics3380 3 года назад

    would this work if the part is set to non-collide?

  • @nishattasnim3198
    @nishattasnim3198 3 года назад

    sir can you make a tutorial of how to make dialogue triggered by touch of a part

  • @AceOfSpadezzz
    @AceOfSpadezzz 4 года назад +1

    How do i make it when a player touches a brick it gives them a certain gear, or if thats possible

    • @CyberCreator
      @CyberCreator  4 года назад

      When the Touched event is triggered, copy whatever gear and make the Parent the players Backpack. You can get the Player with the GetPlayerFromCharacter function. Make sure you check to see if it was a player who touched the brick, if it was get the character, and then clone the tool and set the parent to the player's backpack. developer.roblox.com/en-us/api-reference/function/Players/GetPlayerFromCharacter

  • @gmod6402
    @gmod6402 4 года назад +5

    Is this for the client, I want the players to see different things

    • @CyberCreator
      @CyberCreator  4 года назад +1

      You can make the players see different things if you change something in a LocalScript. So you could check to see if the Touch is occurring by the LocalPlayer's character and do something just for that client

  • @Astro.Editss
    @Astro.Editss 3 года назад

    I was looking for when you touch a part it does a animation

  • @Barmecidy
    @Barmecidy Месяц назад

    I search for a vid actually that detect when part1 touched part2 it will do something without the Hunanoid

  • @turnupbri
    @turnupbri 2 года назад

    Is there a way to make the script fire when it comes in contact with another part?

  • @Aaxled
    @Aaxled 3 года назад

    hey please respond me, so how do i make an object animation like a car play when i touch a block please i need help

  • @heehee6514
    @heehee6514 3 года назад

    How would you make it if two players touched? Because i would like to make a script if one player is bigger then the other and when they touch it would kill the smaller player, i just dont know if there is a different code for players.

  • @buddybuythis3889
    @buddybuythis3889 Год назад

    How would you script playing a sound when a player touches another player?

  • @k1ndaconfused4
    @k1ndaconfused4 2 года назад

    how would i detect a cloned part being touched when there are multiple coned parts?

  • @joephis
    @joephis 4 года назад +2

    how do you figure out the name of the player that touched it?

    • @CyberCreator
      @CyberCreator  4 года назад

      If this was inside a part, it would set the characterName variable to the player's name
      script.Parent.Touched:Connect(function(hit)
      if hit.Parent:FindFirstChild("Humanoid") then
      local characterName = hit.Parent.name
      end
      end)

    • @joephis
      @joephis 4 года назад

      @@CyberCreator ok thx!

  • @Ion115
    @Ion115 3 года назад

    How to make a script, when a part is touched, then an new part appears in workspace?
    But, it needed to be touched with an exact object to run the script

  • @estelino9019
    @estelino9019 3 года назад

    But how to make something like:
    Touched event fires when player touched a part. But if other player will touch it in exact same time(not just break script after first player) nothing will happen.

  • @iceplaysroblox713
    @iceplaysroblox713 3 года назад

    i ahve a problem on anther thing i rebirth can 30k cash then when i do anther event to open a egg the value gets lost bc it is on clint of the rebirth and idk how to do it in server cus its gui

  • @juliendewallers6374
    @juliendewallers6374 4 года назад +1

    hi, i've a question, could u make a video that makes a collectable brick with ontch script ?, because i wanna create a quest for collect items but i find only with "Clickdetector" ! :'(
    thx by advance,

    • @CyberCreator
      @CyberCreator  4 года назад +1

      I plan on making an inventory video which relates to that. if you already have a system that works with ClickDetectors, it should be fairly easy making it work with the Touched event. Join the discord if you're trying to convert it: discord.gg/vrHQCMM