Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how do i make it so when you touch the part a script runs?

Asked by 3 years ago

pls help me im trying to create a island unlocker

1 answer

Log in to vote
0
Answered by 3 years ago
part.Touched:Connect(function(hit) -- The part that hit it
    --run Some code
end)

if you want to retrieve the player you can do:

local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then --Any part can touch it

end

-Ducky

Developer

Youtuber

0
TYSM StevenElijah7019 57 — 3y
Ad

Answer this question