if having trouble with this script, :C
local isTouched = false local alreadyPro = game.Workspace.Characters.AlreadyPro.HitBox local onCollision = function(collidedPart) -- "OI WOTCHIT WILL YA" local partParent = collidedPart.Parent -- Look for a humanoid in the parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") print(humanoid) if isTouched == false and humanoid then print('touched already pro') game:GetService("Chat"):Chat(game.Workspace.Characters.AlreadyPro.Head, "OI WOTCHIT WILL YA", Enum.ChatColor.White) script.Fart:Play() end isTouched = true end alreadyPro.Touched:Connect(onCollision)
Answer: You need a Debounce.
local isTouched = false local alreadyPro = game.Workspace.Characters.AlreadyPro.HitBox local debounce = true -- initialize debounce local onCollision = function(collidedPart) -- "OI WOTCHIT WILL YA" local partParent = collidedPart.Parent -- Look for a humanoid in the parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") print(humanoid) if debounce and isTouched == false and humanoid then debounce = false -- lock debounce print('touched already pro') game:GetService("Chat"):Chat(game.Workspace.Characters.AlreadyPro.Head, "OI WOTCHIT WILL YA", Enum.ChatColor.White) script.Fart:Play() end isTouched = true end alreadyPro.Touched:Connect(onCollision)
Note: You can unlock the debounce whenever you would like. Usually people will wait for something to finish and then allow the debounce to be unlocked. This is done like so:
debounce = true
.