I wan't to know this because I'm trying to add a system where if you touch a specific brick you earn or lose cash, this is my current code,
local part = script.Parent local player = game.Players.LocalPlayer local function onTouch(hit) end script.Parent.Touched:Connect(onTouch)
You would use the GetPlayerFromCharacter() function from "Players".
local function onTouch(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) end end script.Parent.Touched:Connect(onTouch)