Like the title says, I want to detect if the player is touching a part. I know how to do this in a Script, but I need it to be in a local script, so it gets triggered per player. Does anyone know how?
Script attached to No-Collision Part
local self = script.Parent
local function OnPartTouched(coll)
local partParent = coll.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
if can_touch == true then
-- Code here
end
end
end
self.Touched:Connect(OnPartTouched)

4 comments
What you're doing can be done in a script.
self is already a keyword, change it to part or something else in the first line variable name
and script does the same thing
@Xapelize Self is not the issue. The code above works perfectly fine.