Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can some define the script Touched:Wait? [closed]

Asked by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago
Edited 2 years ago

Hello, I was wondering whether something was wrong with my script when I checked line 3, where it says: Touched:Wait do you need to add a :connect or not with a touched event?

local myPart = game.Workspace.Part
local otherPart = myPart.Touched:Wait() 
print("myPart was touched by: ", otherPart.Name)

Edit: (August 18, 2021)

:Wait and wait are similar but return different things:

wait() yields a script until a specified amount of seconds has elapsed.

:Wait()will cause the script to pause until the event occurs once

You can learn more here and here.

Article was edited in case of newer developers or developers in general! Fixed Grammatical errors!

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?