Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why do you need parameters without function??

i dont mean that parameters are useless but sometimes i see scripts that have parameters for no reason :

game.workspace.Part.Touched:Connect(function(hit)
       print("hit") ---- but what is hit?
end)

i only know that parameters can be used like this :

function kill(PlayerName)
      local player = game.workspace:WaitForChild(PlayerName)
      Player:FindFirstChild("HumanoidRootPart"):Destroy()
end

kill("leoonardo101max1")

if you know pls answer this

3 comments

0

Hey!

0

Hey! game.workspace.Part.Touched:Connect(function(hit) -- hit = what is touched the part and dont print("hit") thats print(hit.Name)

0

You have discord? i can help you with scripting but not in this comment section

1 answer

Events like .Touched returns a parameter called a hitPart. The hitPart is any BasePart in the workspace that touched a certain part. If you don't need those parameters, you can just remove them. But some people might have put the parameters they don't need just to be safe or if they will edit their project in the near future and use it.

This discussion is preserved as it was. New answers, comments, and votes are closed.