local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.TargetFilter = nil while wait() do if Mouse.Target and Mouse.Target:IsDescendantOf(game.Players.LocalPlayer.Character) then print("yes") else print("no") end end
it doesnt print yes when my mouse touches a player
Try something like this:
local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local Player = Players.LocalPlayer local Mouse = Player:GetMouse() local textbox = nil -- set textbox here while true do local startPos = Mouse.Origin.Position local endPos = Mouse.Hit.Position local ray = Ray.new(startPos, endPos - startPos) local part = Workspace:FindPartOnRay(ray) if part and part.Parent and part.Parent:IsA("Model") then local found = Players:GetPlayerFromCharacter(part.Parent) if found then textbox.Text = found.Name end end wait(0.1) end