#[COLLISIONS] Player - Part

9 messages · Page 1 of 1 (latest)

steep storm
#

How can we detect if a player touched a part?

#

i know part.touched:connect() or something like it, forgot but it detects player part and not player itself

#

the idea is to open a GUI for the player once he enters there

still ferry
#

um

#

make a function

#

to connect the part with

#

dm me if u still need help

outer bison
#
local Players = game:GetService("Players")

local function OnTouched(Hit)
    local Player = Players:GetPlayerFromCharacter(Hit.Parent)
    
    if Player then
        print(Player.Name .. " touched the part")
    end
end

Part.Touched:Connect(OnTouched)
gentle frigateBOT
#

studio** You are now Level 6! **studio