i was done doing the timer (speedrun timer) but my issue here is the timer gets trigger by arms, legs etc but when i dug into player i saw humanoid root part this made me think if the humanoid touches the part that triggers the timer will work but scripting was difficult but some of it make sense to me so thats why i need help. appreciated if someone help
script.Parent.Touched:Connect(function(p)
if p.Name == "HumanoidRootPart" then
-- add script here
end
end)
1 Like
ianplus’s code can run on any parts with the name “HumanoidRootPart” im assuming you never named your parts that way but this is just to make sure:
script.Parent.Touched:Connect(function(Part)
local Humanoid = Part.Parent:FindFirstChildWhichIsA('Humanoid')
local RootPart = nil
if Humanoid then
RootPart = Humanoid.RootPart or nil
end
if not Humanoid or not RootPart then return end
end)
or:
script.Parent.Touched:Connect(function(p)
local humanoid = p.Parent:FindFirstChild("Humanoid")
if humanoid and p.Name == "HumanoidRootPart" then
--amogus
end
end)