The Post of Absolute Boredom!


  • local mouse = game:GetService('Players').LocalPlayer:GetMouse()
    
    function CastRay(start, endz, ignore)
    	return Workspace:FindPartOnRay(Ray.new(start, (start-endz).Unit*999.999), ignore)
    end
    
    function Click()
    	if game:GetService('Players').LocalPlayer.Character then
    		local hit, pos = CastRay(game:GetService('Players').LocalPlayer.Character:GetModelCFrame().p, mouse.Hit.p, game:GetService('Players').LocalPlayer.Character)
    		if hit and hit.Parent then
    			print('Part Hit:', hit.Name, '\nPosition:', pos)
    		end
    	end
    end
    
    mouse.Button1Down:Connect(Click)
    

    10/10 script I was bored


  • GetModelCFrame is deprecated.


Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.