I’m am trying to achieve is to find the first part with the Name SnowBall from GetTouchingParts()
but I’m am new to lua and tables in general and help in this topic would be nice
--
local Touch = CloneCheckingSnowBallPart:GetTouchingParts()
if table.find(Touch, "SnowBall") then
print("GotSnowBall")
HoldingSnowBall = true
HOLDSNOWBALLSEvent:FireServer(Touch)
else
print(Touch)
print("NoSnowBallFound")
CreateSnowBallEvent:FireServer()
HoldingSnowBall = false
end
okay i have just tried it and it didn’t work, this is how i did it
local Touch = CloneCheckingSnowBallPart:GetTouchingParts()
for index, Parts in Touch do
if Parts.Name == "SnowBall" then
print("GotSnowBall")
HoldingSnowBall = true
HOLDSNOWBALLSEvent:FireServer(Parts)
break
end
end