Y'know the RobloxScriptService thing :Wait()?
like
-- :GetService() is for the laughs game:GetService("Workspace").Part.Touched:Wait() -- blab
I was wondering if you could like, make it so that the event would only get through :Wait() if a parameter of it had a certain value.
I mean like sorta like
script.Parent.Touched:Connect(function(otherThing) local player = game:GetService("Players"):GetPlayerFromCharacter(otherThing.Parent) if player then game:GetService("ReplicatedStorage").TouchEvent:FireClient(player) -- importent script.Parent.TouchEnded:Wait(otherPart = otherThing) -- end game:GetService("ReplicatedStorage").MoveEvent:FireClient(player) end end)
Soo.... yes or no?
RBXScriptSignal:Wait()
takes no arguments, but it returns the values the event was fired with, so we could do this:
local touchedPart = part.Touched:Wait() if touchedPart.Name ~= "The Part We Want" then return end -- Code
Yes, you can.
If you use repeat wait(), you can repeat the wait command until a certain parameter has been met. For example:
repeat wait() until game.Workspace.Part.CanCollide==false
This would wait until the Part does not Collide before proceeding onto the next part of your code.