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)
Local Scripts don't work in the workspace so the code won't run. Put the local script somewhere it's able to run. You can view this page here on the Roblox developer site to see where local scripts are able to run code.