Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Touching Event fired without reason???

So i've made script it's inserted in StarterCharacterScripts and it looks like this

(game is using r15)

local torso = script.Parent:WaitForChild("UpperTorso")

torso.Touched:Connect(function(part)
	print(part.Name)
end)

brick: https://prnt.sc/ntb454

(it's anchored and collision is turned off)

so i was inside the cube then i jumped and touched event fired

none of my body part got outside the cube when i was jumping

so why touched event fired?

3 comments

0

your other body parts touch the torso im pretty sure

0

i print part name and the part name is "area" that is this big part

0

also if i walk in this part it dont happen

2 answers

Robloxian_Hero1234

local torso = script.Parent.Parent:WaitForChild("UpperTorso")

torso.Touched:Connect(function(part)
	if part == " " then else return end
	print(part)
	
end)

now nothing prints :/

6 comments

0

Roblox lua and normal lua is diffrent a bit :/

0

Knowing either is better than nil knowledge :/

0

i don't have nil knowledge

0

Lmfao

0

?

local torso = script.Parent:WaitForChild("UpperTorso")
f = true
torso.Touched:Connect(function(part)
    if part.Parent:FindFirstChild("area") then
if f then
f = false
--what u want to happen in here
wait(1)
f = true
end)

it will only fire when it finds area i also added a so called debounce but u can call it whatever u want, basicly it stops the game from firing the event or whatever all the time and lets it have the cooldown that is inside the wait()

This discussion is preserved as it was. New answers, comments, and votes are closed.