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

How do you have an input while you are touching the block, rather than hitting it?

How do you have an input while you are touching the block, rather than hitting it?

1 comment

0

Do you mean to do something repeatedly until the block is not being touched anymore? If not, hitting and touching something are the exact same thing in Lua.

1 answer

If you mean't by a Robloxian touching it and not anything else you would type this.

function Touched(hit)
if hit.Parent:FindFirstChild("Humanoid")
--the code you would write for what you want to happen when it's touched
end
script.Parent.Touched:connect(Touched)

Make sure you put the script in the part.

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