Nullified0
(Nullified0)
August 28, 2021, 7:59pm
#1
Hi, I’ve been trying to learn Lua for the past couple of days and I’m really confused on killPlayer(otherpart.) What does “(otherpart)” even mean??
Anyways, here’s the code:
local lava = script.Parent
local function killPlayer(otherPart)
end
lava.Touched:Connect(killPlayer)
5kylines
(caden)
August 28, 2021, 8:01pm
#2
I think “otherpart” means the body part you touched the brick with. I’m not sure though.
1 Like
wevetments
(wevetments)
August 28, 2021, 8:02pm
#3
The code itself technically does not do anything other than listen to when the part the script is in gets touched.
otherPart
is the object that touched the part the script is in.
3 Likes
D0RYU
(nici)
August 28, 2021, 8:05pm
#4
1 Like
Nullified0
(Nullified0)
August 28, 2021, 8:15pm
#5
ohhh ok i got it, so its just any part? but what if i had multiple parts that arent humanoids touch it? wouldn’t that lag the game?
wevetments
(wevetments)
August 28, 2021, 8:30pm
#6
The event firing multiple times a second doesn’t have a major performance impact to my knowledge. What’s important is you properly check if the part/s that touch belong to a character.
2 Likes