pls help me with this am confuse
✓ ANSWER ACCEPTED
how do i make it so when someone touches a part i run some coding?
1 answer
✓ Accepted answer
Add a script into the part. Type this code:
script.Parent.Touched:Connect:function(hit) -- When the brick is touched
local h = hit.Parent:FindFirstChildWhichIsA("Humanoid") -- Detecting if the model that touched it contains a humanoid to prevent lag
if h then -- If the model contains a humanoid
--- Type your code here. Remember, 'hit' is the part that touched the brick, and 'h' is the player's humanoid.
end) -- Ends the function.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This is not a request site.