There is a Touched Event Indicator at the Bottom Right showing which Body Part ‘touched’ the ball
This is not the only occurrence, it occurs sometimes. It also happens with other skill moves and I’m unable to replicate it
What solutions have you thought of so far?
I figured it might be the properties of Workspace that I changed. But I haven’t any faithful clue. Please help
local runservice = game:GetService("RunService")
runservice.Heartbeat:Connect(function()
local Items = workspace:GetPartsInPart(script.Parent, OverlapParams.new())
for i,v in pairs(Items) do
local Character = v:FindFirstAncestorWhichIsA("Model")
if Character then
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
if Humanoid then
-- do stuff
end
end
end
end)
Just a simplified version without using the module. But you could always use it. I’d recommend making it custom since theres way more you can do with making it custom, rather than using modules.
Ipairs is faster than pairs and it sorts the table order too.
You can just directly add an “I” before the pair and you’re done.
local runservice = game:GetService("RunService")
runservice.Heartbeat:Connect(function()
local Items = workspace:GetPartsInPart(script.Parent, OverlapParams.new())
for i,v in ipairs(Items) do
local Character = v:FindFirstAncestorWhichIsA("Model")
if Character then
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
if Humanoid then
-- do stuff
end
end
end
end)
However it won’t work on a table like this unlike pairs