Whats the difference between writing code like this -
local speedBoost = script.Parent
local function steppedOn(part)
local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then
parent.Humanoid.WalkSpeed = 64
end
end
speedBoost.Touched:connect(steppedOn)
or writing code like this -
script.Parent.Touched:connect(function(part)
if not part.Parent then return end
local h = part.Parent:FindFirstChild("Humanoid")
if not h then return end
h.WalkSpeed = 16 * 5
end)
I know the first style is function form, because it has 'Local Function' but is there a major difference? they both have the same exact output, increasing your speed by
